I need to use a condition within a filter parameter in a report. Basically the rule is determined by a vachar field that the value of it is 'T' or 'P'. I tried a solution like below but it did not work very well.
The rule is, if the field is 'T' filtered by the Dt_Cad field, if the value is 'P' filtered by the Dt_emission field. Anyone know if this is possible?
Below my attempt to resolve
Thanks for everyone's help
WHERE (CASE
WHEN NotFis.Tp_Nota='P' then
NotFis.DT_Emissao between '2018-01-01' and GETDATE()
ELSE NotFis.dt_CAD between '2018-01-01' and GETDATE()
END)