Help with Simple SQL Statement

  • Thread starter Thread starter Adam Hicks
  • Start date Start date
A

Adam Hicks

I was thinking this was a no brainer and was going to be
really simple but it's not working that way. This is a
Access 2000 DB, and what I have to do is get a report to
show projects completed between Jan, 2000 and Dec. 31,
2003. So I thought I would just do a simple SQL statement
using this command
WHERE [Date Cmp] > 1/1/2000 AND [Date Cmp] < 12/31/2003;

This doesn't work it doesn't give me anything. The format
of the field is Date/Time. does anyone know the statement
I will need??

thanks Adam
 
You need to enclose the dates in #s:
WHERE [Date Cmp] > #1/1/2000# AND [Date Cmp] < #12/31/2003#;
 
Andrew said:
You need to enclose the dates in #s:
WHERE [Date Cmp] > #1/1/2000# AND [Date Cmp] < #12/31/2003#;

can also be written as

WHERE [date cmp] BETWEEN #1/2/2000# AND #12/30/2003#

because your borders are sharp, this may read a little confusing.
 
Back
Top