I'm using show-csv to serve the results of a report to the user. When I run this query directly against the database, it returns the correct results:
SELECT *
FROM ticket
WHERE date_raised >= '2011-01-01'
AND date_raised <= '2011-06-30'
AND severity = 3
ORDER BY problem_no
But when run the query based on parameters it executes and gives me a file with no results:
<show-csv query="get-range-csv" filename="{$query.filename}">
<param name="start-date" value="{$query.start-date}" />
<param name="end-date" value="{$query.end-date}" />
<param name="severity" value="{$query.severity}" />
</show-csv>
SELECT *
FROM ticket
WHERE date_raised >= {$start-date}
AND date_raised <= {$end-date}
AND severity = {$severity}
ORDER BY problem_no
Relevant screen code:
<container position="relative" height="46">
<container left="0">
<text-static left="0" width="80" text="Start date:" />
<date-select field="query.start_date" left="80" />
</container>
<container left="210">
<text-static left="0" width="70" text="End date:" />
<date-select field="query.end_date" left="70" />
</container>
</container>
Any ideas why I'm not getting any results from ?
I've run this through the debugger and the query dataset variables are set correctly when runs.