Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Passing parameter (date) to sql query
Migrateduser
Hi there,<br />
<br />
I'm a newbie to Birt. I'm designing a report which pick parameter from users. below is my sample sql script. Postgresql is the db.<br />
<br />
select<br />
account.account_id,<br />
(select count(transaction_id) FROM transaction WHERE transaction.account_id = account.account_id AND transaction.amount < 0::numeric and reversed = 'f') as no_of_payment,<br />
(SELECT sum(transaction.amount * -1::numeric) FROM transaction WHERE transaction.account_id = account.account_id AND transaction_type_id not in (1,10) and reversed = 'f' and date_trunc('month', tran_date) = <strong class='bbc'>date_trunc('month', date('20120901')))</strong> AS paid, <br />
(select sum(amount) from promise where promise.account_id = account.account_id and date_trunc('month', promise_date) = <strong class='bbc'>date_trunc('month', date('20120901'))</strong> and broken <> 't') as ptp_amt,<br />
from account<br />
where client_id = ?<br />
<br />
now i manage to set parameter for client_id but how do set parameter for <strong class='bbc'>paid and ptp_amt</strong> so that user can choose the month instead coding it in script? And the month show display as list box on report viewer.<br />
<br />
How someone can assist me on this. Thanks.
Find more posts tagged with
Comments
There are no comments yet