I don't get all of the desired results when I use the following SQL statement. Can anyone help????
I need the info for all units that have:
1. R17 = 1
AND
2. Started within the selected range (10/20-10/27).
OR
3. Stopped within the selected range.
OR
4. Started previous to the range and has not yet stopped.
I have several units that started before the selected range and have a StopDateTime of NULL, but they are not returned with the Recordset.Code:SELECT Data_Unavailable.*, SiteDefinition.CustomerName
FROM Data_Unavailable, EquipmentDefinition, OSMDefinition,
SiteDefinition
WHERE (Data_Unavailable.SerialNumber = EquipmentDefinition.SerialNumber
AND
EquipmentDefinition.OSMName = OSMDefinition.OSMName AND
OSMDefinition.SiteName = SiteDefinition.SiteName AND
Data_Unavailable.R17 = 1) AND
((StartDateTime >= '10/20/2000' AND
StartDateTime < '10/28/2000') OR
(StopDateTime >= '10/20/2000' AND
StopDateTime < '10/28/2000') OR
(StopDateTime = NULL))
ORDER BY Data_Unavailable.SerialNumber
Thanks for the help!!!!
