Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calc number of weeks between two dates?
Message
From
17/05/2002 18:56:36
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to calc number of weeks between two dates?
Miscellaneous
Thread ID:
00658482
Message ID:
00658482
Views:
67
Maybe because it's Friday afternoon, but I can't seem to figure out this problem. Any help would be greatly appreciated.

I am working on a Human Resources project, that in part, has to determine some benefit accruals based on years of service, etc. etc. (Why do Union guys have better benefits than I do anyway? Oh well, that's a different topic better discussed over a couple of beers!)

One accrual is dependent on the number of weeks that have elapsed. One approach is to write out to a table accruals for every pay period or at month, quarter, or year end close.

But I think it would be better to calc the accruals on the fly and without having to create and maintain yet another table. And this brings us to the place where I need help.

Does anyone know a method for calculating the number of weeks that have elapsed between two dates? If only 3 days of a begining or ending date are in the date range, then that week is not counted. If 4 or more days are in a beginning or ending week, then the week is counted in the total.

Again, any insight, comments or LOL remarks would be appreciated.

Thanks
Don Lowrey
Next
Reply
Map
View

Click here to load this message in the networking platform