Get last day of the next three months with Crystal Report -


i heading find out formula date last day of next 3 months crystal report. i've tried code below shows message when out of array of month (1-12). please give me advice address problem.

totext(date(year({rptiexsaleinvoicesummary.etd}),month({rptiexsaleinvoicesummary.etd})+4,1)-1, "dd-mmm-yyyy") 

it works fine if etd's month less 8. however, might cause problem when more 9, 10 image below.

1

i've found solution. please let me know if have idea solve problem.

if (month({rptiexsaleinvoicesummary.etd})+4) > 12  totext(date(year({rptiexsaleinvoicesummary.etd})+1,month({rptiexsaleinvoicesummary.etd})-8,1)-1, "dd-mmm-yyyy") else totext(date(year({rptiexsaleinvoicesummary.etd}),month({rptiexsaleinvoicesummary.etd})+4,1)-1, "dd-mmm-yyyy") 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -