Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Days in month
Message
De
05/11/2007 12:05:42
 
 
À
05/11/2007 06:38:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01266644
Message ID:
01266759
Vues:
9
>There is a way to know how many days I have in specific month(29/30/31)?
(for example I call the fanction ?func?({09/09/2006})

Here's my two-cents worth:
FUNCTION DayInMonth
LPARAMETERS pnMonth
RETURN DAY(GOMONTH(DTOC(TRANSFORM(pnMonth)+"/01/"+TRANSFORM(YEAR())),1)-1)
Above code takes a month number as input and does the following:

1. Convert pnMonth to a date value for first of month
2. Goes to first day of next month
3. Subtracts one day for the last day of month input
4. Uses DAY() function to get the number of the days and returns value
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform