0
votes

Could some one please help me to mention First working day date and Last working Day Date of last month in Crystal Repoerts (8.5),

I need to use last month's first and last business day date for monthly report generation on first working day of the month.

In record selection I would like to give condition on value date, so that records will be only from earlier month.

For example if today is 1st jul 2014 (01-07-2014) then i shall get formula in record selection on Value date (say field is Value_Date) as,

first day of earlier month: 02-06-2014
last day of earlier month:  30-06-2014
2

2 Answers

0
votes

Assuming Value_Date is a Date Field try belwo formula in Record Selection.

Value_Date>=DateSerial(Year(currentdate),Month(currentdate)-1,1) and
Value_Date<DateSerial(Year(currentdate),Month(currentdate),1)
0
votes

Try this

if DayOfWeek(DateSerial(Year(currentdate),Month(currentdate),1),1) =1  
   then DateSerial(Year(currentdate),Month(currentdate),1+1) 
else if DayOfWeek(DateSerial(Year(currentdate),Month(currentdate),1),1) = 7
   then DateSerial(Year(currentdate),Month(currentdate),1+2) 
else 
   DateSerial(Year(currentdate),Month(currentdate),1)