I am using the following formula in Crystal Reports 11 to calculate the number of hours a service request is opened taking out Saturdays and Sundays. However, when the request has a time logged that falls on a Saturday or Sunday, those hours are not subtracted.

Local DateTimeVar d1 := {tblservicerequest.timelogged};

Local DateTimeVar d2 := {tblservicerequest.timeclosed};

(DateDiff ("h", d1, d2) -

DateDiff ("ww", d1, d2, crSaturday) * 24 -

DateDiff ("ww", d1, d2, crSunday) *24)

For example:
Time Logged = Sunday, 11/9/08, 8:58pm
Time Closed = Monday, 11/10/08, 9:17am
Total Hours opened calculated by formula = 13
Total Hours opened should be = 10

How can I get the formula to subtract the hours for requests opened on a Sat or Sun?