Help! Query which date as a criteria

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

Guest

Hi all

I want to make a query to show the transaction of today. But the date data is full date and time in the table. I use the condition date=Date() but there is no shown in the query. Please Help
 
Hi Danny!

Have you tryed with NOW()?

// Niklas


Danny said:
Hi all,

I want to make a query to show the transaction of today. But the date data
is full date and time in the table. I use the condition date=Date() but
there is no shown in the query. Please Help
 
You have almost diagnosed your own problem in your question. You tell
us that your date field contains date and time parts. The value
returned by Date() is a date number with no time part, corresponding
to midnight on the given date. Unless you have records with an
identical date _and_ _time_ value, your query will be empty. The most
straightforward way of getting all records having today's date (and
any time) is to use the condition:

Between Date() And (Date() +1)

For the pedant, this will include records dated exactly at midnight at
the end of the day in question. If that is undesirable, you can use
..9999 instead of 1 in the calculation.

Hi all,

I want to make a query to show the transaction of today. But the date data is full date and time in the table. I use the condition date=Date() but there is no shown in the query. Please Help

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 

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

Similar Threads

Criteria for select query. 2
query on date 1
Date Criteria Range 1
BUILDING UNION QUERY 9
Date Criteria 4
criteria on form 1
#error - Blank 3
How to make a query records as criteria to the other query 1

Back
Top