C
cafe
(1) is way better: see
http://support.microsoft.com/support/kb/articles/Q100139.ASP
Here's one way of doing it.
tblTool
ToolID (PK)
Descrition ("24 watt scrumper bumper")
other details of the tool in question
tblBooking
ToolID ( composite )
StartTime ( primary key )
Duration (1 hour, whatever)
To find all tools available on Monday between 12 and 4pm:
SELECT *
FROM tblTool AS t
WHERE NOT EXISTS
( SELECT 1
FROM tblBooking AS b
WHERE b.ToolID = t.ToolID
AND b.StartTime + b.Duration BETWEEN xxx AND yyy )
where xxx and yyy are whatever syntax you need to identify Monday 12pm &
Monday 4pm respectively.
HTH,
TC
(off now for 24 hours)
http://support.microsoft.com/support/kb/articles/Q100139.ASP
Here's one way of doing it.
tblTool
ToolID (PK)
Descrition ("24 watt scrumper bumper")
other details of the tool in question
tblBooking
ToolID ( composite )
StartTime ( primary key )
Duration (1 hour, whatever)
To find all tools available on Monday between 12 and 4pm:
SELECT *
FROM tblTool AS t
WHERE NOT EXISTS
( SELECT 1
FROM tblBooking AS b
WHERE b.ToolID = t.ToolID
AND b.StartTime + b.Duration BETWEEN xxx AND yyy )
where xxx and yyy are whatever syntax you need to identify Monday 12pm &
Monday 4pm respectively.
HTH,
TC
(off now for 24 hours)