Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Days in month
Message
From
05/11/2007 12:05:42
 
 
To
05/11/2007 06:38:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01266644
Message ID:
01266759
Views:
8
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform