Problem of Date Field Selection

ctkmak

Registered User.
Local time
Today, 15:48
Joined
Sep 25, 2004
Messages
11
I have a table to store the new append records from a SQL statement. In this table I have defined a "Status Date" in field type date/time with format dd/mm/yyyy. However, when execute the SQL append statement, the system has appended the record with format of dd/mm/yyyy hh:mm:ss.

The problem is when I run the report with a date range input, the report cannot select any records with such date range. I have examined the table format is correct, but I found the data actually included the time in it. Do anyone know how to overcome this problem?
 
Ary you by any chance using the Now() function (date and time) in stead of the Date() function? That could explain it.

Remember the format is just about visual apperance, not what's actually stored.
 
By the nature of Date/Time fields, they ALWAYS contain both components regardless of what you specify as a format. If you want to work with only the date part of a field, you can use DateValue(YourDate). If you want to work with only the time component, you can use TimeValue(YourDate).

If you don't actually want to store a time, use the Date() function rather than the Now() function. Now() stores both the current date and time but Date() stores only the current date.
 

Users who are viewing this thread

Back
Top Bottom