Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Days in month
Message
From
05/11/2007 07:29:56
Mike Yearwood
Toronto, Ontario, Canada
 
 
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:
01266667
Views:
7
>Hi
>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})

Hi Chaim

Sergey's formula is correct, but IMO it is actually two functions in one.

This part means get the first day of the month: ldDate-DAY(ldDAte)+1. That of itself should be a UDF. FirstDayOfMonth(m.ldDate)

Then there is the part that gets the last day of the month.

GOMONTH(FirstDayOfMonth(m.ldDate),1) -1

So what Sergey said is:

?Day(LastDayOfMonth(m.ldDate))

Check out the versions on the wiki

http://fox.wikis.com/wc.dll?Wiki~FirstDayOfMonth

http://fox.wikis.com/wc.dll?Wiki~LastDayOfMonth

The goal is not to write and decipher formulas, but "The goal is to create routines with internal integrity (strong cohesion) and small, direct, visible, and flexible relations to other routines (loose coupling)."
Previous
Reply
Map
View

Click here to load this message in the networking platform