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

Expression Criteria Help

Status
Not open for further replies.

msk7777

Technical User
Jul 22, 2008
9
US
I have a criteria written as

>=DateAdd("h",7,[Start Date]) And <=DateAdd("h",19,[End Date])

this works great but I now need to do one from 7AM-7:15PM. How can I change my criteria to state that?
 
G'day msk,

how 'bout
Code:
between #07:00:00# and #07:15:00# ?

Fyi, dateadd can add minutes to a time too, just use:

Code:
dateadd("n", 15, now)

to add 15 mins to now.

Does that help?

JB
 
Either:
Between DateAdd("h",7,[Start Date]) And DateAdd("n",19*60+15,[End Date])

Or:
Between ([Start Date]+#07:00#) And ([End Date]+#19:15#)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks! Sorry I thought I replied to this already, I just came back to refer to it once more and I realized I never said thank you!
 
PHV,

The DateAdd version you gave works great, I needed to adjust it for 30 minute increments (such as 7:00AM to 7:30AM)where the same expression works great, but i am having difficulty adjusting it for a time increment such as 7:30-8:00AM. Can you help me with that?
 
Nevermind, figured it out on my own,I used Between DateAdd("n",450,[Start Date]) And DateAdd("n",480,[End Date]). But your expression helped me change to that line of thinking so thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top