I have a report that contains 2 subreports. I need to obtain data in each subreport based on a date range. The main report does not require this. I created the parameter DateRange with type date and a variable also named DateRange with the following syntax.
dateTimeVar start := minimum({?DateRange}) + iif(minimum({?DateRange}) = {?DateRange}, 0, 1);
dateTimeVar end := maximum({?DateRange}) - iif(maximum({?DateRange}) = {?DateRange}, 0, 1);
booleanVar lowerbound := totext(year(start), 0) <> "0";
booleanVar upperbound := totext(year(end), 0) <> "0";
stringVar txtstart := totext(start, "d MMM yyyy");
stringVar txtend := totext(end, "d MMM yyyy");
if not lowerbound then //no start
"Up to " + txtend
else if not upperbound then //no end
"After " + txtstart
else
"Between " + txtstart + " and " + txtend;
Typically I set the date field in my table equal to the DateRange variable. I cannot figure out how to pass the parameter DateRange or variable DateRange to my subreports and use it to filter records. I keep getting data type errors.