General information
Category:
Coding, syntax & commands
Title:
How to calc number of weeks between two dates?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only