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 :[code="sql"]SELECTCount(*) RecordCountFROM 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 <= ?[/code]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!
↧