Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: First Business Day Of Month Post Reply Post New Topic
Author Message
mrc161
Newbie
Newbie


Joined: 27 Dec 2007
Location: United States
Online Status: Offline
Posts: 19
Quote mrc161 Replybullet Topic: First Business Day Of Month
     Posted: 22 Jan 2008 at 8:06am
Does anyone know if it's possible to create a formula that would identify the first BUSINESS day of the month?
 
For example, using January, is there any way of having a formula recognize the 1st as not being a business day?
 
What I'm trying to get to is I have a report that utilizes MonthToDate.  However, when we reach the first business day of the month, I want the report that runs that day to utilize LastFullMonth.
 
I'd like to avoid creating two separate reports, one of which would only run at the first of the month.  So I'd like a report that chooses MonthToDate unless it's the first business day of the month, then utilizes LastFullMonth.
 
Any suggestions?  Thanks! 
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 22 Jan 2008 at 9:05am
Perhaps the simplest solution would be to extend your criteria a bit.  If the day of the month is less than or equal to 5, include LastFullMonth and MonthToDate.  If not, just MonthToDate.  But that is moving the goalposts.

The general issue is identifying that January 1 is not a business day.  Identifying weekends is simple.  Identifying holidays is not.  After all, many businesses have different holidays from the standard federal/banking holidays (and that's not even taking international considerations into account).

Most solutions involve creating a Holidays table in your database, and doing a sort of negative join with this table.  Do a standard left join from your primary data source to the Holidays table, but only select records where the Holidays date is NULL.


IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum