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!

Working With Time

Status
Not open for further replies.

CIBS

Technical User
Nov 15, 2007
73
0
0
GB
Hi

I am using CR9

I want to split my calls into 2 catagories.

Catagory 1 - Business Time
Catagory 2 - Out Of Hours

Working Hours Monday - Friday 08:00 - 17:00

how do I create a formula that looks at the date feild and then returns either one of the 2 values below based of the criteria above.

In Business Hours (Monday - Friday 08:00 - 17:00)
Outer Business Hours. (Monday - Friday 17:01 - 07:59 , & Allday Saturday, Sundays, Bank holidays)

The date field is an actual date field containing the date & Time (Call_Logged_Date)

Please Help

Kind Regards

Stephen
 
Try this formula:

//PURPOSE OF FORMULA: Determine Business and Non Business HOurs
//VARIABLE DECLARTIONS:
Timevar TimeCall:=time({YourDateTimeField});//the time
Numbervar TheWeekDay:=Dayofweek({YourDateTimeField});//the day of the week as a number
//FORMULA RESULT:
if TimeCall in time(#7:00:00 AM#) to time(#6:00:00 PM#)
and TheWeekDay in [2,3,4,5,6]//Monday to Friday
then 'business hours' else 'out of business hours'
;

Gordon BOCP
Crystalize
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top