Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone have a AfterFirstBusDayOf Month function?
Message
From
17/01/2003 04:15:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/01/2003 13:33:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00742471
Message ID:
00742779
Views:
19
No problem :) I was in a hurry to leave yesterday and placed fix in wrong place :) Revised version :
? Indate > FirstBizDay(Indate)

FUNCTION FirstBizDay
LPARAMETERS ldDate
LOCAL FDOM
FDOM = ldDate - Day(ldDate) + 1 + iif(month(ldDate)=1,1,0)
RETURN FDOM + IIF(DOW(FDOM,2)>5, 8-DOW(FDOM,2), 0)
Labor day being 1st monday wouldn't make Sep 2 first biz day. It is in the list of 'holidays'.
Cetin

>*grin*
>
>Jan 3rd was the first business day of 2000, not Jan. 4th. I'm only giving you a hard time because that was the point of Bill's original question. January is a special case, and he wants it to work properly.
>
>And Sept. is another special case in the US. Labor Day is *always* the first Monday of the month.
>
>>Oh come on. Special cases are almost endless thinking of the world countries and holidays shifting each year. Just for Jan 1st you could say :
>>
>>
>>? Indate > FirstBizDay(Indate)
>>
>>FUNCTION FirstBizDay
>>LPARAMETERS ldDate
>>LOCAL FDOM
>>FDOM = ldDate - Day(ldDate) + 1
>>RETURN iif(month(ldDate)=1,1,0)+;
>>FDOM + IIF(DOW(FDOM,2)>5, 8-DOW(FDOM,2), 0)
>>
And still shorter :)
>>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