Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date range within date range
Message
 
 
À
21/04/2009 17:10:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01395821
Message ID:
01395850
Vues:
116
This message has been marked as the solution to the initial question of the thread.
ldNewStart = MAX(Range1Start, Range2Start)
ldNewEnd = MIN(EVL(Range1End, {^9999-12-31}), Range2End)
>
>I need to count the number of days of a date range that fits within another date range. For example:
>
>range1 = 2/10 - 2/15
>range2 = 2/12 - 2/25
>Range1 fits in 4 days on range 2.
>
>range1 = 2/20 - 2/29
>range2 = 2/12 - 2/25
>Range1 fits in 6 days on range 2.
>
>range1 = 2/13 - 2/15
>range2 = 2/12 - 2/25
>Range1 fits in 3 days on range 2.
>
>Furthermore range1 could have an empty end date which means there's no limit to the end date, example:
>range1 = 2/15 -
>range2 = 2/12 - 2/25
>Range1 fits in 11 days on range 2
>
>I'm doing this with IIFs in my query, but I'm thinking maybe someone can think of a more simple way to calculate this.
>
>Thanks!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform