Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write the criteria in a query to find specific info in a date/time fld

Status
Not open for further replies.

Newatprogramming

Technical User
Mar 5, 2002
30
US
Any help would be great.

I am trying to get info from a date/time field that is setup as ( 6/12/2002 1:15:05 PM )

I set it up like this:

>=[enter a beginning date] and <[enter a end date]

This works fine but I need to narrow it down, and want to set it so that info can be requested and not have to write some function each time I want to use this it.

Another words I want to set it to ask give me all the data

from example ( a date and time through a date and a time )


// 6/11/2002 6:00:00 PM until 6/12/2002 2:30:00 AM
 
You can do this by using a form with two text boxes. BegDateTimePrompt and EndDateTimePrompt. After the user enters the appropriate data the criteria can use that information in the query.

SELECT tblYourTable.ID, tblYourTable.SearchDate
FROM tblYourTable
WHERE (((tblYourTable.SearchDate) Between [Forms]![YourFormName]![BegDateTimePrompt] And [Forms]![YourFormName]![EndDateTimePrompt]));

Is this what you are looking for.

Bob Scriver
 
If you want a different Criteria in the query like Between one time and then just <= another that can also be done. Just come back and let me know and I can show you that also.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top