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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter for a date field?

Status
Not open for further replies.

misha8765

Instructor
May 8, 2006
9
0
0
US
Thank you in advance for your help.

I have the following statement in the criteria of the date and time field in a query:

Between #5/12/2006 8:00:00 AM# And #5/12/2006 5:00:00 PM#

How can I add a parameter into this expression so I can simply type in the date and not the time to and get a result without changing my query each time.

Thank you
 
Code:
PARAMETERS [Enter Start Date] Date, [Enter End Date] Date;

Select ...
From   ...
Where DateField BETWEEN [Enter Start Date] AND [Enter End Date]

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
PARAMETERS [Enter Date] Date;
SELECT ...
FRPM ...
WHERE DateField BETWEEN ([Enter Date]+#8:00:00 AM#) AND ([Enter Date]+#5:00:00 PM#)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top