Expressions in Queries and reports in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having trouble with this expression in the criteria field:
Between [Enter Start date] and [Enter End Date]
This is supposed to return results between and inclusive of two dates.
However, when answered for example: Between 10/01/06 and 12/31/06--No results
in December come up. When answered: Between 09/30/06 and 12/31/06--No
december and i get beginning of september. Can anyone help??

thanks
Bill
 
Date parameters can act funny for some reason lost on me. But if you
explicitly declare your parameters they should work as expected. The
paramters can easily be added if you open the query in design view and click
on Query>Parameters. Fill in your 2 parameters. Switching to SQL view will
look like this:

Parameters [Enter Start date] DateTime, [Enter End Date] DateTime;
SELECT *
FROM BLah
WHERE MyDates Between [Enter Start date] and [Enter End Date]
 
Thanks for answering. However, The parameters explained below are in the
query's criteria area. I will check SQL. Was there any change between Access
1997 and Access 2003 that might be the root cause of this error??

Bill

Bill Mosca said:
Date parameters can act funny for some reason lost on me. But if you
explicitly declare your parameters they should work as expected. The
paramters can easily be added if you open the query in design view and click
on Query>Parameters. Fill in your 2 parameters. Switching to SQL view will
look like this:

Parameters [Enter Start date] DateTime, [Enter End Date] DateTime;
SELECT *
FROM BLah
WHERE MyDates Between [Enter Start date] and [Enter End Date]


--
Bill Mosca, MS Access MVP


Bill said:
I am having trouble with this expression in the criteria field:
Between [Enter Start date] and [Enter End Date]
This is supposed to return results between and inclusive of two dates.
However, when answered for example: Between 10/01/06 and 12/31/06--No
results
in December come up. When answered: Between 09/30/06 and 12/31/06--No
december and i get beginning of september. Can anyone help??

thanks
Bill
 
Furtherdevelopment

I tried the "query Parameters" you decribed below, Bill. I got an error
message that said something like: Expression is to complex to comply with.
Use variables.

I still have the same problem

Bill W



Bill Mosca said:
Date parameters can act funny for some reason lost on me. But if you
explicitly declare your parameters they should work as expected. The
paramters can easily be added if you open the query in design view and click
on Query>Parameters. Fill in your 2 parameters. Switching to SQL view will
look like this:

Parameters [Enter Start date] DateTime, [Enter End Date] DateTime;
SELECT *
FROM BLah
WHERE MyDates Between [Enter Start date] and [Enter End Date]


--
Bill Mosca, MS Access MVP


Bill said:
I am having trouble with this expression in the criteria field:
Between [Enter Start date] and [Enter End Date]
This is supposed to return results between and inclusive of two dates.
However, when answered for example: Between 10/01/06 and 12/31/06--No
results
in December come up. When answered: Between 09/30/06 and 12/31/06--No
december and i get beginning of september. Can anyone help??

thanks
Bill
 

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