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

Records Between 5:00pm and 7:00am 1

Status
Not open for further replies.
Sep 11, 2008
25
US
Crystal XI = Version

I have a datetime field (SubmitDate)and need to select records in the last 6 months with a SubmitDateTime after hours, that is from 5:00 p.m. until 7:00 a.m.

How do I select that 5:00 p.m. until 7:00 a.m. timeframe?

Thank you!
 
off of the top of my head, perhaps something like this:

(Time({Table.SubmitDate}) > 5:00pm and
Time({Table.SubmitDate}) < 11:59:59pm)
or
(Time({Table.SubmitDate}) > 12:00:00am and
Time({Table.SubmitDate}) < 7:00am)
 
A little clarification:

(
(
Time({Table.SubmitDate}) > time(17,0,0) and
Time({Table.SubmitDate}) <= time(23,59,59)
)
or
(
Time({Table.SubmitDate}) > time(0,0,0) and
Time({Table.SubmitDate}) < time(7,0,0)
)
)

...and then add your date criteria.

-LB

 
Thank you, Mr. Bass! You really ARE a genius. This solution works perfectly.
[bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top