Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding the payperiod that included 12th of month
Message
De
17/07/2006 19:18:40
 
 
À
17/07/2006 19:15:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01137078
Message ID:
01137100
Vues:
18
>>>So... let me think. Q&D solution:
>>>
>>>
* try with 12th of the first date's month
>>>d12=date(year(d1), month(d1), 12)
>>>*-- if first date is past 12th, use 12th of the second date
>>>if d12<d1
>>>  d12=date(year(d2), month(d2), 12)
>>>endif
>>>scan for between(d12, d1, d2)
>>>  && do stuff here
>>>endscan
>>
>>I think this would work (uses Julian date):
>>
>>
BETWEEN(SYS(11,DATE(YEAR(PpBeg),MONTH(PpBeg),12)),SYS(11,PpBeg),SYS(11,PpEnd)) ;
>   OR BETWEEN(SYS(11,DATE(YEAR(PpEnd),MONTH(PpEnd),12)),SYS(11,PpBeg),SYS(11,PpEnd))
>
>I was also tempted to make it a one-liner but resisted it for clarity's sake. Payroll report never hinges on a couple of milliseconds more or less.

I didn't realize how big this would be until after I posted it. I built it up with a cut & paste of the two parts. Thanks for making it more readable.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform