Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Advance datefield by one month
Message
De
17/04/2009 11:07:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01395275
Message ID:
01395279
Vues:
74
This message has been marked as a message which has helped to the initial question of the thread.
GOMONTH (ldOldDate, 1)
HTH

>I have a date field and need to advance by one month.
>
>I thought that just adding one month would work and does for dates like
>
>4/15/2009 ........ 5/15/2009
>
>However if i have 3/31/2009 and advance by one month will give me a blank date because there is no 4/31/2009
>if MONTH(ldOldDate) < 12
>   ldNewDate = DATE(YEAR(ldOldDate),MONTH(ldOldDate)+1,DAY(ldOldDate))
>else
>    ldNewDate = DATE(YEAR(ldOldDate)+1,MONTH(1),DAY(ldOldDate))
>endif
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform