Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weeks worked between two dates
Message
De
05/12/2007 07:31:12
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
04/12/2007 15:07:41
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01273137
Message ID:
01273228
Vues:
16
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform