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!

URGENT: Count # of business days elapsed

Status
Not open for further replies.

kridg

IS-IT--Management
May 8, 2000
13
0
0
US
The database stores the date as a string ("19910731"), and (thanks Malcolm!) I was able to convert the string to a date value.

Now I need to count the number of days that have elapsed since the case was opened, but have to exclude Saturday and Sunday.

If the CurrentDate is 8/21/2000 and the FileDate is 8/1/2000 the correct answer (excluding Sat & Sun) would be 15. I get 21.

Thanks for any help!
 
This formula needs V8 to work, so I hope you have it.
DateVar EachDate := {FileDate};
NumberVar BusDays ;
While EachDate <= CurrentDate
Do
(If DayOfWeek(EachDate) < 6 then
BusDays := BusDays + 1 ;
EachDate := EachDate + 1
);
BusDays;

This may need some tweaking, depending on how you count business days. Ie, if the date range is from Monday to Tuesday in one week, is that one or two days?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top