Click to See Complete Forum and Search --> : SQL BETWEEN Dates


GUIR
07-20-2007, 10:37 AM
Hi!

I am in need of extract data from a table, which are between two dates.

The table contains a field called 'date' .

I want to extract all fields of records pertaining to a date peiod (That is between two dates)

The db is Ms Access.

I used

SELECT * FROM sales WHERE date BETWEEN #10/07/2007# AND #15/07/2007#

The table contains data between above two dates, but query return empty resultset. The field type of date field is set as Date/Time in Access.

Is there anything wrong with above query, or else how should I design a working query for same purpose.

Your advice will be a great help for me.

Best Regards

mattyblah
07-20-2007, 11:28 AM
put brackets around date, like this [date]. also, are you sure you have a row where the date is between the two dates you list?