Sinfathisar
Registered User.
- Local time
- Yesterday, 19:04
- Joined
- Jan 29, 2009
- Messages
- 60
Hi there,
I have a form with its underlying query built from a table. Users access this form by entering a date when prompted. I am having trouble fine tuning the criteria to prompt for the date because underlying field in the table is date/time (general date) - formatted like this: i.e. 2/14/2007 1:14:00 AM.
The field must be a date/time because the client wants to record this information, and the date is initially input (synced) into the access database from a handheld device (using Syware Visual CE).
I want the user to be able to enter a date (either **/**, **/**/**, **/**/****) and return all records from the entire DAY (12am to 11:59pm). This is easy enough if the date is a short date, but no so for date/time.
I was able to use the like statement to sort of get this to work, but it does not work if the date is entered in the format **/**/** (i.e. 04/14/09) because the like statement only allows differences to the ends of what the user inputs, not in the middle, so the missing 20 from 2009 confuses it.
This is the like statement:
Like "*" & [Enter the Date] & "*"
I also tried using the integer date to crop the decimal from microsoft's date, but access just got confused by this and did not return any records.
This is the int statement:
Int[Enter the Date]
I also tried variations on the int date, but none of them are working. I do have a sub report that uses a between int date to pull up records and that works fine, but it is pulling the criteria from information on the main report, not from user input criteria.
I was hoping someone might have some idea as to how I can make this work without making a note on the switchboard that you have to type the date a certain way.
Thanks in advance
I have a form with its underlying query built from a table. Users access this form by entering a date when prompted. I am having trouble fine tuning the criteria to prompt for the date because underlying field in the table is date/time (general date) - formatted like this: i.e. 2/14/2007 1:14:00 AM.
The field must be a date/time because the client wants to record this information, and the date is initially input (synced) into the access database from a handheld device (using Syware Visual CE).
I want the user to be able to enter a date (either **/**, **/**/**, **/**/****) and return all records from the entire DAY (12am to 11:59pm). This is easy enough if the date is a short date, but no so for date/time.
I was able to use the like statement to sort of get this to work, but it does not work if the date is entered in the format **/**/** (i.e. 04/14/09) because the like statement only allows differences to the ends of what the user inputs, not in the middle, so the missing 20 from 2009 confuses it.
This is the like statement:
Like "*" & [Enter the Date] & "*"
I also tried using the integer date to crop the decimal from microsoft's date, but access just got confused by this and did not return any records.
This is the int statement:
Int[Enter the Date]
I also tried variations on the int date, but none of them are working. I do have a sub report that uses a between int date to pull up records and that works fine, but it is pulling the criteria from information on the main report, not from user input criteria.
I was hoping someone might have some idea as to how I can make this work without making a note on the switchboard that you have to type the date a certain way.
Thanks in advance