SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Multi Parameter DB2 query for oledb dataset in SSRS.


Multi Parameter DB2 query for oledb dataset in SSRS.

Author
Message
Learner093
Learner093
SSC Rookie
SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)

Group: General Forum Members
Points: 31 Visits: 49
I am trying to execute a DB2 query in a SSRS dataset using the oledb data provider. I have written the query as where parameter values are replaced by :

SELECT
Count(*) RecordCount
FROM HBIDATA.DTAMTH M
WHERE (M.DXMTSTG = 0 or M.DXMTSTG is NULL) and (M.ABILSYS = 'STG' or M.ABILSYS = 'WHOLESALE') and (M.EFDATE8 <= Replace(Cast((date(?) + 30 days) as Char(10)), '-', ''))
AND CRDT <= ?



where '?' are to be replaced by the parameter values.
I have also tried writing this query as an expression, but it gives some error messages which does not imply the error clearly.

Th expression I have written is below, but it is somewhere wrong.

= "SELECT Count(*) RecordCount FROM HBIDATA.DTAMTH M WHERE (M.DXMTSTG = 0 or M.DXMTSTG is NULL) and (M.ABILSYS = 'STG' or M.ABILSYS = 'WHOLESALE') and (M.EFDATE8 <= Replace(Cast((date(" & Parameters!BatchDateDMY.Value ") + 30 days) as Char(10)), '-', '')) AND CRDT <='" & Parameters!BatchDateISO.Value "'"

Please let me know how you would have written this in SSRS query/expression. Thanks!
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62334 Visits: 13298
Please do not crosspost. It wastes peoples time and fragments replies. Original post can be found here:

[url=http://www.sqlservercentral.com/Forums/Topic1477702-150-1.aspx][/url]


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search