Thunder-Bolt
Thunder-Bolt

Reputation: 15

first and last business day date formula in crystal for monthly report

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

Upvotes: 0

Views: 2496

Answers (2)

Nat Roy
Nat Roy

Reputation: 1

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)

Upvotes: 0

Siva
Siva

Reputation: 9101

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)

Upvotes: 0

Related Questions