1
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' filter by the Dt_cad field, if the value is 'P' filter by the Dt_output field. Someone knows if this is possible?
Down with my attempt at solution
Thanks for all your 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)
Hello Ricardo. Excellent your first solution. I was trying to think of something like this, but I couldn’t. It was right. Thanks also for the explanation
– Mauricio Barcelo da Costa