View Full Version : Input Parameter Date Format


TLW
03-21-2002, 12:55 PM
I have created a query in which I prompt for the user to input a date and time. Here is the statement I have used in my query for the input parameter:
"Between [Enter Production Start Date and Time:] And [Enter Production End Date Time:]"
When the user runs the report it will prompt for the user to enter a beginning date and time and ending date and time, however, the format for the parameter must be like so:
03/21/02 8:00AM. How can I change this to accept other date and time formats such as the following (I am mainly interested in Date formats):
3-2-02,3/2/02,03/02/2002,03-02-2002....
Any help with this would be greatly appreciated. Thanks.

Geoff Codd
03-22-2002, 05:23 AM
set an input mask so the user will automatically enter the data in one format

TLW
03-25-2002, 05:47 AM
Hello and Thanks for the response, I cannot get this mask to work with what I am trying to do. IF you or anyone else has any idea how to to do this please let me know.
Thanks

David R
03-25-2002, 07:42 AM
Instead of an input mask, try bracketing your parameters with "#" symbols (in quotes so they're taken literally). I've used that structure repeatedly in the past with few problems, but you do have to occasionally define your parameters explicitly as dates. Another option is to go up into the parameter definitions and define it more clearly there.

Post back if you're having further troubles,
David R

TLW
03-25-2002, 07:53 AM
Could you please elaborate on where the "#" symbols should be placed in the parameter.
Thanks

David R
03-25-2002, 10:19 AM
I apologize, I skimmed your initial post and should have read more clearly. You can use parameters without the literal "#" enclosures on a Date/Time field and leave off the time. What it will do is assume a 'Time' section of (I believe) 12:00:00 AM, i.e. midnight. This allowed me to get identical results to 3-25-02, 3/25/02, 03/25/02, 03/25/2002, etc.
However because it assumes midnight as the time, you will get no results if you choose the same start and end date, since the time inbetween will effectively be 0.

To allow for specific times of the day AND variable formatting of the way it is input, I would look into using the Date/Time Picker', similar to a calendar. Search the archives of this site for 'date time picker'.

Good luck,
David R

TLW
03-25-2002, 10:21 AM
Thanks for the help you provided.