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

no saturday or sunday

Status
Not open for further replies.

mdahlen

Technical User
Feb 26, 2003
6
0
0
US
Current turnaround time forumla is below. I want to exclude Saturday and Sunday from the equation. Suggestions? Thanks.
I've looked at the DayOfWeek function, but not sure how to apply it.

(DateTimeValue ({Report.date_signed_out},{Report.time_signed_out})
-DateTimeValue ({Case.date_entry},{Case.time_entry}))* 24
 
what about excluding Saturday and Sunday in the report criteria?

... always in a state of [ponder] ... inspiring to some day experience [idea] ...
 
I have made the following assumptions regarding the querie.

That there are no date enteries occurring on a weekend.
Date entries from monday to friday

// the variable test determines if there was a fisrtdayofweek (Sunday) between the two dates given//

local numbervar test := datediff(ww,DateTimeValue({Case.date_entry},{Case.time_entry})),(DateTimeValue ({Report.date_signed_out},{Report.time_signed_out})

if test = 0 then
(datediff(d,DateTimeValue({Case.date_entry},{Case.time_entry})),(DateTimeValue ({Report.date_signed_out},{Report.time_signed_out})* 24
else
(datediff(d,DateTimeValue({Case.date_entry},{Case.time_entry})),(DateTimeValue ({Report.date_signed_out},{Report.time_signed_out}) -
(test * 2)) * 24

I hope this is of some help.
Have not tested it.

 
This should to the trick for number of days.
If you want hours, adjust accordingly:
---------------------------------------------------------
Local DateTimeVar d1 := DateTimeValue ({Report.date_signed_out},{Report.time_signed_out});

Local DateTimeVar d2 := DateTimeValue ({Case.date_entry},{Case.time_entry});

DateDiff ("d", d1, d2) -
DateDiff ("ww", d1, d2, crSaturday) -
DateDiff ("ww", d1, d2, crSunday) ;
---------------------------------------------------------

Cheers,
- Ido



CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Check out my faq faq767-4465 ...

Reebo
UK

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."
- Albert Einstein (1879-1955)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top