You could substitute your monthnumber for month({table.date}). If you are always basing it on the currentyear, substitute currentdate for {table.date}.
If month({CLIENT.CLI_UPD_DATE}) in [9, 4, 6, 11] then 30
else if month({CLIENT.CLI_UPD_DATE}) in [1, 3, 5, 7, 8, 10, 12] then 31
else
if month({CLIENT.CLI_UPD_DATE}) = 2 and isdate("Feb 29, "&totext(year({CLIENT.CLI_UPD_DATE}),0,"")) = true then 29 else 28
Replace date field with one of yours and save
right Click on Custom function and select new.
Give it a name eg NumberOfDays and select extractor
The above formula will be available to use. select it and function will build automatically. Save and then create a new formula.
In formula type function name NumberOfDays( Newdate field)
NumberOfDays will be blue to show its a function, place formula in details and it will return number of days.
Thank you so much. I have already built exactly the same way you mentioned. But I just wanted to confirm that there is a built-in function in Crystal to do this. May be it is worthy to have one in the later versions of Crystal.
Thank you for all your help,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.