[AccessD] Need Query Help

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed Oct 21 08:04:59 CDT 2009


I have a table with 4 fields PID, SDate, Chase_Start_Date and SDate_2.
I need to extract records based on the following criteria.

1. Sdate < 1/1/2005
2. Don't include record with SDate <1/1/2005 if Chase_Start_Date < 1/1/2005
3. Do include record if SDate <1/1/2005 and SDate_2 is < 1/1/2005

The Chase_Start_Date and SDate_2 fields may be blank or just the Sdate_2 field if the Chase_Start_Date field has data.

I have been working on this for a while and thought I had it with the following SQL statement but no. Time for another set of eyes to look at it.

SELECT SDate, Chase_Start_Date, SDate_2
FROM Constants
WHERE (((SDate)<#1/1/2005#) 
AND ((Chase_Start_Date) Is Null)) 
OR (((SDate)<#1/1/2005#) AND ((SDate_2)<#1/1/2005#));

Thanks.

Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.





More information about the AccessD mailing list