input value short date over a longdate feild

action

Registered User.
Local time
Tomorrow, 04:24
Joined
May 29, 2003
Messages
89
I need to create a parameter query which applies a criteria using a short date in the parameter input but the field is a date/time field. How can I wild card the time in the paramater as that is irrelvant?

My date field looks like: 14/08/2003 6:50:00 p.m. but I want the parameter to only need 14/08/2003 to work.


Cheers
 
In your query, create a new "field" called NewDate or something that's relevant - follow your new field name with a colon like below and the following text:

NewDate: Format([YourDateTimeField], "dd/mm/yyyy")

This will convert your date to a string, but in the format you wish it to be.

In the criteria you can then put your parameters and it will accept dates in the above format.

HTH
 
Be VERY careful when you convert dates to strings. Although the suggested solution will work when you are looking for a specific date, it will NOT work for a range or for sorting for that matter. Use CDate(YourField) to extract just the date part of a date/time value.
 
thanks, the string works fine for my needs. cheers
 

Users who are viewing this thread

Back
Top Bottom