SPECIFYING DATE RANGE IN A QUERY

G

Guest

Hello All.
I am designing a query in MS Access and need to create a quarterly report.
When I use the expression Between '01/01/2005' AND '04/01/2005' I get all the
records! Syntax is correct as per ANSI-92??
 
R

Rick Brandt

HELP said:
Hello All.
I am designing a query in MS Access and need to create a quarterly
report. When I use the expression Between '01/01/2005' AND
'04/01/2005' I get all the records! Syntax is correct as per
ANSI-92??

So who says Access is compliant with ANSI 92?
In Access dates are delimited with #. You're also better off using
yyyy-mm-dd formatting for your date literals within the query.
 
G

Guest

The right syntax for date will be, to put the # symbol before and after the
date
Between #01/01/2005# AND #04/01/2005#
that incase you trying to filter on a date field
 
G

Guest

Thanks Ofer, this helped in the end!

Ofer said:
The right syntax for date will be, to put the # symbol before and after the
date
Between #01/01/2005# AND #04/01/2005#
that incase you trying to filter on a date field
 

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

Top