Hello everyone,
I've created a report with a date selection parameter to allow users to select from a list of date range option from the Date Range function in Crystal Reports. However, the defaulted function doesn't have an option for last 12 months. I've attempted to create a formula for the Last 12 Months but keep getting an error stating "A boolean is required here". When I use the Last 12 Months formula by itself on a different report it work fine but when combining to the date range parameter below I get the error. Could someone please help me take a look at my Last 12 Months formula and let me know what I did wrong. I am using Crystal Reports 2008.
{Incdnt.FormCreateDate} in
(if {?Run Time Option} = 'Last Full Day' then (DataDate - 1) to (Datadate - 1) else
if {?Run Time Option} = 'Last Full Week' then LastFullWeek else
if {?Run Time Option} = 'Last Full Month' then LastFullMonth else
if {?Run Time Option} = 'Month To Date' then MonthToDate else
if {?Run Time Option} = 'Year To Date' then YearToDate else
if {?Run Time Option} = 'Last 12 Months' then {Incdnt.FormCreateDate} >= Date(DateAdd("m", -12, Date(Year(CurrentDate), Month(CurrentDate), 1))) and
{Incdnt.FormCreateDate} < Date(Year(CurrentDate), Month(CurrentDate), 1) else
{?Date Range})
Thank you so much for your assistance in advance!
TC
I've created a report with a date selection parameter to allow users to select from a list of date range option from the Date Range function in Crystal Reports. However, the defaulted function doesn't have an option for last 12 months. I've attempted to create a formula for the Last 12 Months but keep getting an error stating "A boolean is required here". When I use the Last 12 Months formula by itself on a different report it work fine but when combining to the date range parameter below I get the error. Could someone please help me take a look at my Last 12 Months formula and let me know what I did wrong. I am using Crystal Reports 2008.
{Incdnt.FormCreateDate} in
(if {?Run Time Option} = 'Last Full Day' then (DataDate - 1) to (Datadate - 1) else
if {?Run Time Option} = 'Last Full Week' then LastFullWeek else
if {?Run Time Option} = 'Last Full Month' then LastFullMonth else
if {?Run Time Option} = 'Month To Date' then MonthToDate else
if {?Run Time Option} = 'Year To Date' then YearToDate else
if {?Run Time Option} = 'Last 12 Months' then {Incdnt.FormCreateDate} >= Date(DateAdd("m", -12, Date(Year(CurrentDate), Month(CurrentDate), 1))) and
{Incdnt.FormCreateDate} < Date(Year(CurrentDate), Month(CurrentDate), 1) else
{?Date Range})
Thank you so much for your assistance in advance!
TC