Date criteria

  • Thread starter Thread starter Sport
  • Start date Start date
S

Sport

When I try to use the following as the parameter for a query I get an error.

Between #date()# and #date()# -1

Basically I'm trying to automate the report to pull up the last 24hrs.
 
Hi Sport.
Try using Between now() and now()-1
Hope this helps
Fons
 
I had thought of that, but doesn't that take time into account aswell?
 
I think that should be:

Between (Date() -1) and Date()

The "#"s are certainly not needed, because Date() behaves like a
variable rather than a constant, and I think that Between expects you
to be going from lower to higher.

When I try to use the following as the parameter for a query I get an error.

Between #date()# and #date()# -1

Basically I'm trying to automate the report to pull up the last 24hrs.

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
I have tried that on a few tables I have and I think if
you set the format to short date, it works.
Take care.
Fons
 

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