Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weeks worked between two dates
Message
From
04/12/2007 16:05:49
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
04/12/2007 15:18:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01273137
Message ID:
01273152
Views:
19
>>Hey all
>>
>>Without resorting to some looping code, I'm trying to meet a business rule. If a person works different shifts in a single calendar week, they pay dues once for that calendar week.
>>
>>
>>Start        End
>>2007-12-02 2007-12-02 <- 2007 week 49 to 2007 week 49
>>2007-12-04 2008-01-02 <- 2007 week 49 to 2008 week 1
>>
>>So I want to include only the second record because the 1st week is already accounted for in the second record.
>>
>>Further, is there no way to express weeks as a number that spans several years to simplify subtraction?
>>
>>Thanks
>
>Does it help to reduce to one record by doing a MIN(start) and MAX(end)?

I was thinking along the lines of min(week(start)) but week() doesn't cross years - which will be needed to calculate elapsed weeks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform