cancel
Showing results for 
Search instead for 
Did you mean: 

RE Date Formula

Former Member
0 Kudos

Hi New to crystal. On v11.

I need a formula that will print the date of the 18th of the month following statement date but only if it's on a workday. Otherwise it needs to use the previous fridays date if the 18th falls on a weekend?

Can anyone help me?

TN

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

didn't get you question properly, what i understood is you wish to have date as 18 for the month and year of statement date with previous day weekend logic

Try the below formula

datevar iDate:= Date(year(stDate),month(stDate) ,18 );

if weekday(iDate)=7 then

DateAdd ("D",-1 , iDate)

else

if weekday(iDate)=1 then

DateAdd ("D",-2 , iDate)

else

iDate

where stdate is your statement date

Former Member
0 Kudos

Excellent. Worked like a charm.

Answers (0)