onlyanarkali
MIS
Hi there....newbie here trying to use Crystal Reports 8.5....
I am trying to create a new sql expression field called BatchCount in the subreport. The sql i wrote for it is:
(select count(distinct batch_id) from audit_batch inner join LU_Application on audit_batch.cur_workstate=LU_Application.workstate
where audit_batch.useraction_id=26 and audit_batch.actiontimestamp between '2008-01-01' and '2008-01-14' and LU_Application.Mnemonic='SubDocRepair')
This works fine and gives me the count as 13.
Now I wanna replace the hardcoded values with values passed by the user. So instead of 'SubDocRepair', I put {?Mnemonic where Mnemonic is a parameter I created which will accept user input. So now it looks like this:
(select count(distinct batch_id) from audit_batch inner join LU_Application on audit_batch.cur_workstate=LU_Application.workstate
where audit_batch.useraction_id=26 and audit_batch.actiontimestamp between '2008-01-01' and '2008-01-14' and LU_Application.Mnemonic={?Mnemonic)
However this keeps erroring up. Also the Mnemonic parameter is a string and the LU_Application.Mnemonic is a varchar field. Does that matter? I wanna be able to do the same for the dates too...
Any clues...pls Help
Thanks in advance