Date Criteria

  • Thread starter ai_enjoi via AccessMonster.com
  • Start date
A

ai_enjoi via AccessMonster.com

Hi!

What criteria should be placed in the query so that it should look up
values in the field that start from Date1 to Date2. I have this criteria:
"Between [Forms]![Form1]![StartDate] And [Forms]![Form1]![LastDate]" which
only looks for values in between (I know, it only includes the values in
between the dates because of the 'Between', that's why I'm asking for help.)
the dates and not including the StartDate and LastDate. What should i put
instead of 'Between'?

Thanks for those who would help! Any help would be gladly appreciated!
 
A

Allen Browne

You should bet the items that match the StartDate.

If the date field has a time component, you won't get the last date, so
specify less than the next day, i.e.:
= [Forms]![Form1]![StartDate] And < ([Forms]![Form1]![LastDate]+1)

It may help Access understand the dates correctly if you:
a) Set the Format property of both unbound text boxes on your form to Short
Date or similar.

b) Declare the parameters. In query design view, choose Parameters on the
Query menu, and enter 2 rows:
[Forms]![Form1]![StartDate] Date/Time
[Forms]![Form1]![LastDate] Date/Time

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ai_enjoi via AccessMonster.com said:
Hi!

What criteria should be placed in the query so that it should look up
values in the field that start from Date1 to Date2. I have this criteria:
"Between [Forms]![Form1]![StartDate] And [Forms]![Form1]![LastDate]" which
only looks for values in between (I know, it only includes the values in
between the dates because of the 'Between', that's why I'm asking for
help.)
the dates and not including the StartDate and LastDate. What should i put
instead of 'Between'?

Thanks for those who would help! Any help would be gladly appreciated!
 

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