Using Between

N

Noah

Does anyone know how to use BETWEEN in a query? I want to
select rows from a table that are between two dates. I
searched in Access help and couldn't find anything on
using this. I use the keyword 'BETWEEN' in DB2 but I
don't know if I can use it in Access...
 
J

Joan Wild

Noah said:
Does anyone know how to use BETWEEN in a query? I want to
select rows from a table that are between two dates. I
searched in Access help and couldn't find anything on
using this. I use the keyword 'BETWEEN' in DB2 but I
don't know if I can use it in Access...

SELECT Orders.*
FROM Orders
WHERE OrderDate Between #8/1/2004# And #8/31/2004#;
 
F

fredg

Does anyone know how to use BETWEEN in a query? I want to
select rows from a table that are between two dates. I
searched in Access help and couldn't find anything on
using this. I use the keyword 'BETWEEN' in DB2 but I
don't know if I can use it in Access...

In the query SQL:
Where [YourTable.[DateField] Between [Enter Start Date] And [Enter End
Date]

As long as your date field does NOT include a Time value, the above
will return all records between the 2 entered dates (through the End
date). If the Date does include a Time value, post back.
 
J

Jesseb

=[Start Date] and <=[End Date]


fredg said:
Does anyone know how to use BETWEEN in a query? I want to
select rows from a table that are between two dates. I
searched in Access help and couldn't find anything on
using this. I use the keyword 'BETWEEN' in DB2 but I
don't know if I can use it in Access...

In the query SQL:
Where [YourTable.[DateField] Between [Enter Start Date] And [Enter End
Date]

As long as your date field does NOT include a Time value, the above
will return all records between the 2 entered dates (through the End
date). If the Date does include a Time value, post back.
 
Top