Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weeks worked between two dates
Message
From
05/12/2007 07:31:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
04/12/2007 15:07:41
Mike Yearwood
Toronto, Ontario, Canada
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:
01273228
Views:
18
>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.

Now here's an example of ambiguous specs... What goes into the "else" of your "if"?

- person who works same shifts in a single calendar week, they pay what and how many times?
- person who works different shifts in multiple calendar weeks, they pay what and how many times?
- person who works same shifts in a multiple calendar week, they pay what and how many times?
- is it possible that some of them pay dues multiple times for that calendar week?
- is it possible that some of them pay dues once for some other calendar week?

I figure you passed the rule to us as it was passed to you - but you had the additional benefit of live contact to whoever invented the rule, or at least with someone who had the privilege of applying it. For the rest of us programmers, there's just text.

Ah, and BTW, why not create a table of weeks, with starting (and ending?) date(s), and ordinal number (off an arbitrary start)? Then you'd just look how many weeks fit between your two dates, without any need to recalculate anything. And the chance that the weeks table will change while the rest of the app stays are quite slim. If they change the way they define a week, there are larger changes afoot and you'd probably have to change about half of the app :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform