Using CR8.5, DB2 v7
I am writing reports against a series of table where the dates are defined as DateTime. Here is a sample of the fields data: 2004-11-07-21.00.01.000000
I create a parameter and set it's data type to be date, range values.
In the report record selection criteria I enter
{RPT_CBC_BILLING.PICKUP_BY} = {?Dates}
I get an error saying string is required here, pointing at my parameter.
I've used the formula
cdate(val(mid({RPT_CBC_BILLING.PICKUP_BY},1,4)),val(mid({RPT_CBC_BILLING.PICKUP_BY},6,2)),val(mid({RPT_CBC_BILLING.PICKUP_BY},9,2))) = {?Dates}
with good results...If I am only using it to filter the records to be selected.
However I get a sum cannot be generated when using this formula (probably because the date is being read as a string):
Sum ({RPT_CBC_BILLING.CHARGES}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") +
(
Sum ({RPT_CBC_BILLING.STOPS}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") *
Maximum ({RPT_CBC_BILLING.STOPS_RATE}, {RPT_CBC_BILLING.PICKUP_BY}, "daily")
) +
(
Sum ({RPT_CBC_BILLING.DROP_HOOK}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") *
Maximum ({RPT_CBC_BILLING.DROP_HOOK_RATE}, {RPT_CBC_BILLING.PICKUP_BY}, "daily")
)
I've been told to make sure that File > Report Options > Convert Date-Time Field: is set to Date or Date Time. I've done both with neither working. Currently it is set to Date.
What do I need to do to get CR to treat these fields as dates?
I am writing reports against a series of table where the dates are defined as DateTime. Here is a sample of the fields data: 2004-11-07-21.00.01.000000
I create a parameter and set it's data type to be date, range values.
In the report record selection criteria I enter
{RPT_CBC_BILLING.PICKUP_BY} = {?Dates}
I get an error saying string is required here, pointing at my parameter.
I've used the formula
cdate(val(mid({RPT_CBC_BILLING.PICKUP_BY},1,4)),val(mid({RPT_CBC_BILLING.PICKUP_BY},6,2)),val(mid({RPT_CBC_BILLING.PICKUP_BY},9,2))) = {?Dates}
with good results...If I am only using it to filter the records to be selected.
However I get a sum cannot be generated when using this formula (probably because the date is being read as a string):
Sum ({RPT_CBC_BILLING.CHARGES}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") +
(
Sum ({RPT_CBC_BILLING.STOPS}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") *
Maximum ({RPT_CBC_BILLING.STOPS_RATE}, {RPT_CBC_BILLING.PICKUP_BY}, "daily")
) +
(
Sum ({RPT_CBC_BILLING.DROP_HOOK}, {RPT_CBC_BILLING.PICKUP_BY}, "daily") *
Maximum ({RPT_CBC_BILLING.DROP_HOOK_RATE}, {RPT_CBC_BILLING.PICKUP_BY}, "daily")
)
I've been told to make sure that File > Report Options > Convert Date-Time Field: is set to Date or Date Time. I've done both with neither working. Currently it is set to Date.
What do I need to do to get CR to treat these fields as dates?