Query records with todays date but I NEED the time included

paindivine

Registered User.
Local time
Yesterday, 19:18
Joined
Dec 13, 2006
Messages
23
I have a basic trouble ticket type database that I built. It records troubles and auto fills the date and time when a new records created. I want a simple query that will display the number of calls that each person has taken today.

The problem being that If I use >Date()-1 I will get calls from this time yesterday until now. Is there a way to round down the time to today only? I don't want to lose my time stamp.

Thanks!
 
One way to get a particular day's records:

Between [Forms]![frmCriteria].[txtDate] & " 00:00:00AM" And [Forms]![frmCriteria].[txtDate] & " 11:59:59 PM"
 
I find this puzzling
If I use >Date()-1 I will get calls from this time yesterday until now.

As Date() defaults to a time of 00:00:00 it should return all of yesterdays and todays until now, >Now-1() would have returned what you stated.
It is because of Date() 's time default that Michael's suggestion works, Pbaldy's gives flexibilty for you to input a particular date when a form is used to provide the date.

Brian
 
Brianwarnock said:
I find this puzzling


As Date() defaults to a time of 00:00:00 it should return all of yesterdays and todays until now, >Now-1() would have returned what you stated.
It is because of Date() 's time default that Michael's suggestion works, Pbaldy's gives flexibilty for you to input a particular date when a form is used to provide the date.

Brian

Ah yes, that works. I think I'll just use >Date(), I don't think anyones going to make a record at midnight.

Thanks!
 
One more question:

How can I count these records up by agent?
So my query will return:

Todays records
Jim - 12
Tom - 15
Jane - 21
Karla - 15
 
I figured it out. My query now looks like:

Code:
Agent    |   Agent    |  OrderDate

Groupby  | Count      | Where
Show     |  Show     | Dontshow
        |               | >=Date()
 
You could also use the format function in a query

DateValue(Format([DateField],"MM/DD/YY"))

this will basically stip off the time value and just leave the date
 

Users who are viewing this thread

Back
Top Bottom