First Working Day in Crystal Reports
From time to time, to save on resources and make things easier you have to bodge certain items. Today’s example is generating a different report on the first working day of the month than the rest of the month. Crystal Reports doesn’t offer the functionality to identify the first working day of the month, so i’ve created the following fuction:
Function FirstWorkingDayOfMonth(d as Date)
dim td as date
' Grab the first day of the month and check what day of the week it is
td = datevalue(Year(d),Month(d),1)
select case dayofweek(td,crMonday)
case 6
' Saturday
FirstWorkingDayOfMonth = datevalue(year(d),month(d),3)
case 7
' Sunday
FirstWorkingDayOfMonth = datevalue(year(d),month(d),2)
case else
FirstWorkingDayOfMonth = td
end select
End Function
Just incase this is handy for anyone else.

How I have to apply this to my report..Crystal doesn’t gives us option to write the function
Neeraj
30 Jun 09 at 12:35 pm
@Neeraj
Add it as a Report Custom Function.
Andrew Williams
30 Jun 09 at 4:55 pm