Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Multi Parameter DB2 query for oledb dataset in SSRS. Expand / Collapse
Author
Message
Posted Thursday, July 25, 2013 2:51 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 5, 2014 1:27 PM
Points: 9, 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!
Post #1477750
Posted Friday, July 26, 2013 1:24 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:43 AM
Points: 13,275, Visits: 10,152
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1477890
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse