date criteria

  • Thread starter Thread starter sin
  • Start date Start date
S

sin

Guest
I have this exercise I am doing for access on a sample database. I have already made a table form etc...there is a field with date in the form.. "1/6/2004" for example.
The exercise wants me to set, for example, criteria between two dates. How do I do that?
I used >#1/6/2004# AND <#30/6/2004#

for finding etc betweeen 1/6/2004 and 30/6/2004
but it doesnt work...

What is the correct syntax of this kind of expression?

thanx!
 
Try BETWEEN 1/6/2004 AND 8/6/2004

The second month you used (30) is not a month number. It must be between 1 and 12. Hope this helps.
 
To use the # sign to delimit dates, you need to put the dates in US format. So the criteria for the date field is:-

Between #6/1/2004# And #6/30/2004#


If it is a parameter query, you can use a criteria for the date field like this:-

Between [Enter start date] And [Enter end date]

When the query is run, you will be prompted for the start date and the end date. You can enter the dates in the same format as the system date i.e.

1/6/2004
30/6/2004
.
 

Users who are viewing this thread

Back
Top Bottom