I have a working SQL statement I can run against my database. Now I want to use that query to print the report. HOW do I use the SQL as-is in the report to select the records? I can "Show SQL query", but it doesn't let me MODIFY that query.
Here is the query (the elipses just mean that it continues for each period of the year - I have custom date ranges for each period so I can't just use the month functions builtin):
select
sum(case when bill_date
between cast('2008-01-01-00.00.00.
0000' as timestamp)
and cast('2008-01-27-00.00.00.
0000' as timestamp)
then total_charges else 0 end) as period_1,
sum(case when bill_date
between cast('2008-01-27-00.00.00.
0000' as timestamp)
and cast('2008-02-23-00.00.00.
0000' as timestamp)
then total_charges else 0 end) as period_2
.
.
.
from tlorder
Start Free Trial