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 though query like using ?(optional parameter)
Migrateduser
<p>Hi,</p>
<p> </p>
<p> This is Syam .Am working on Birt tool,Here I got one problem i.e. am passing parameter through query using ? .if i give one input value that time am getting out put .when i am passing null value that time am getting error</p>
<p> </p>
<p> </p>
<p>This is my query</p>
<p>
select if(? + INTERVAL a + b DAY in (select DATE_FORMAT(emp_attendance.date, '%Y-%m%-%d') from emp_attendance<br>
left join employee ON emp_attendance.employee_id = employee.id<br>
left join emp_type ON employee.emp_type_id = emp_type.id<br>
where month(emp_attendance.date)=?<br>
and year(emp_attendance.date)=?<br>
and <span style="color:#ff0000;">employee.id=?</span>),(select employee.id<br>
from emp_attendance<br>
left join employee ON emp_attendance.employee_id = employee.id<br>
left join emp_type ON employee.emp_type_id = emp_type.id<br>
where month(emp_attendance.date)=?<br>
and year(emp_attendance.date)=?<br><span style="color:#ff0000;">and employee.id=?</span><br>
and ? + INTERVAL a + b DAY in (DATE_FORMAT(emp_attendance.date,'%Y-%m%-%d'))),<span style="color:#ff0000;">?</span>) as empid<br>
FROM<br>
(SELECT 0 a UNION SELECT 1 a UNION SELECT 2 UNION SELECT 3<br>
UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7<br>
UNION SELECT 8 UNION SELECT 9 ) d,<br>
(SELECT 0 b UNION SELECT 10 UNION SELECT 20<br>
UNION SELECT 30 UNION SELECT 40) m<br>
WHERE ? + INTERVAL a + b DAY <= ( SELECT (select date(last_day(? + INTERVAL a DAY )) FROM<br>
(SELECT 0 a UNION SELECT 1 a UNION SELECT 2 UNION SELECT 3<br>
UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7<br>
UNION SELECT 8 UNION SELECT 9 ) d<br>
WHERE last_day(? + INTERVAL a DAY )<br>
group by last_day(? + INTERVAL a DAY )))<br>
ORDER BY a + b</p>
Find more posts tagged with
Comments
There are no comments yet