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

Setting Date Parameter

Status
Not open for further replies.
Feb 4, 2004
1
US
is there any type of formula or parameter that I can use to break up the day into three parts. For example that would show all work done from 6:30am-2:30pm, 2:30pm-10:30pm and from 10:30pm-6:30am.
 
You could set up a formula and then group on it. Something like this:

{@TimeGroup}
Local WorkTime TimeVar;
WorkTime := {DateTime field};
if (WorkTime >= Time(6, 30, 0)) and (WorkTime < Time(14, 30, 0)) then 1
else if (WorkTime >= Time(14, 30, 0)) and (WorkTime < Time(22, 30, 00)) then 2
else 3

This will give you 1 for your first time period, 2 for the second, and 3 for the third so that you can group records by the time periods you're interested in.

-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top