Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Days
Message
From
17/10/2000 13:29:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00429936
Message ID:
00430421
Views:
8
>>
>>lnFullWeeks = max(week(date(),1,2),0)
>>lnFirstWeekDays = max(8-dow(date(year(date()),1,1),2) - 2,0)
>>lnThisWeekDays = iif(week(date(),1,2)=1,0,min(dow(date(),2),5))
>>lnWorkDays = lnFullWeeks * 5 + lnFirstWeekDays + lnThisWeekDays

Yes George,
That happens when your fingers type different than your mind thinks.) max() had a purpose there :)

lnFullWeeks = max(week(date(),1,2)-2,0)

Walter, week() function has optional parameters specifying when a week starts and what fdow is.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform