Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of Mondays in a month
Message
From
20/10/2016 12:55:21
 
 
To
20/10/2016 12:18:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01642129
Message ID:
01642162
Views:
47
>
>Close Data All
>Set Date short
>Set Date French    &&change to american
>
>Create Cursor ycurs(xdate d,xmonth i,xday c(10))
>Local Date0
>Date0=Inputbox("Any date ?","",Trans(Date()) )
>Date0=Ctod(Date0)
>
>
>Local xm
>xm=Ctod("01/01/"+Trans(Year(Date0)) )
>
>
>For i=1 To 365   &&gather all dates of specified year of date typed
>	Insert Into ycurs Values (xm+i,Month(xm+i),Cdow(xm+i))
>Endfor
>
>
>Sele ycurs
>*Brow
>Browse  For  xmonth=Month(Date0) And Allt(xday)=="lundi" Nowait &&change to monday
>Count To nd  For xmonth=Month(Date0) And Allt(xday)=="lundi"
>Messagebox ( "month "+Trans(Month(Date0))+"/"+Trans(Year(Date0))+" contains : "+Trans(nd)+" lundi  ",0+32+4096)
>Use In "ycurs"
>
>Retu
>
>can extend to any day....
Merci, Yousfi.
That's a very clever solution.
I might not use it in this case, but I'm sure I'll find another use for it.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Reply
Map
View

Click here to load this message in the networking platform