Using Between

  • Thread starter Thread starter Noah
  • Start date Start date
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...
 
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#;
 
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.
 
=[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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top