I am comparing 2 date fields (minutes between) using the datediff function. My formula is working correctly, but now I need to further constrain the time calcultated between the 2 dates.
Currently I have:
datediff("n",{TBL1.Date1},({TBL1.Date2})).
I need to only consider business hours and weekdays. Is there any way (easy or not) to do this?
According to CR help file, I should be able to restrict it to weekdays (in their example below) but it does not seem to be working for me. However, even if it does work I am not sure how I can restrict the calculation to business hours (8 to 5) only.
Here is the CR example for restricting to weekdays:
//Crystal syntax
Local DateTimeVar d1 := {Orders.Order Date};
Local DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) -
DateDiff ("ww", d1, d2, crSaturday) -
DateDiff ("ww", d1, d2, crSunday)
Any ideas?
-- Jason
"It's Just Ones and Zeros
Currently I have:
datediff("n",{TBL1.Date1},({TBL1.Date2})).
I need to only consider business hours and weekdays. Is there any way (easy or not) to do this?
According to CR help file, I should be able to restrict it to weekdays (in their example below) but it does not seem to be working for me. However, even if it does work I am not sure how I can restrict the calculation to business hours (8 to 5) only.
Here is the CR example for restricting to weekdays:
//Crystal syntax
Local DateTimeVar d1 := {Orders.Order Date};
Local DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) -
DateDiff ("ww", d1, d2, crSaturday) -
DateDiff ("ww", d1, d2, crSunday)
Any ideas?
-- Jason
"It's Just Ones and Zeros