format help. Drop time stamp

travismp

Registered User.
Local time
Today, 16:39
Joined
Oct 15, 2001
Messages
386
I have a field in my database called [RecordDate] which is a date & time stamp. In my query I have

">Date() Or Date()"

to find all tests from today.

Q1.) Is there a better way to write this?
Q1.) I want to remove the time stamp from the result for this query. I need to total a column and Count the number of records for each client but it does not function correctly due to the time stamps. Sooooo how do I drop the time stamp completely in the query results?

thank you!
 
What is the Or supposed to accomplish? You can drop the time with either the Format() function or the DateValue() function.
 
I tried

=Format(Date())

with no luck. This will only show records that have no time stamp at all. The recrods with time stamps will not show with this.
 
You'd want to use either function on your field, not Date(), which is only the date anyway.
 
You'd want to use either function on your field, not Date(), which is only the date anyway.

I do not understand.

So if my field name is [RecordDate] which function would I use to show all records entered today with no time stamp?
 
This type of thing:

SELECT...WHERE Format([RecordDate],"m/d/yy")="12/29/08"
 
OK so if I want this for today, could I do this?

Format([RecordDate],"m/d/yy")="Date()"
 
No, the quotes would goof it up ("Date()" becomes a literal string rather than the date). Try this:

WHERE DateValue([RecordDate])=Date()
 
If you got a data type mismatch on the one using DateValue, I suspect you have Null values in that field somewhere. They would cause that error.
 
Hi -

Agree with Paul. Don't believe it's the DateValue() function causing the problem.

Here's an example (from the debug (immediate) window) of the DateValue() and TimeValue() functions:

Code:
x = now()
? x
12/29/2008 7:33:09 PM 

y = datevalue(x)
? y
12/29/2008
 
z = timevalue(x)
? z
7:33:09 PM

Bob
 

Users who are viewing this thread

Back
Top Bottom