Hi, I'm looking for help on below formula. I wrote like this but am getting wrong data.
=If(AND(N3="A", R3>O3), R3,If(AND(N3="P",S3>O3),S3,If(N3="D","",If(OR(Q3="P",Q3="A")*AND(P3>TODAY(),P3>O3),P3,O3))))
select case when N='A' and R>O THEN R
when N='P' and S>O then S
when N='D' then ''
when (Q='P' or Q='Á') and p>getdate() and P>O then P else O end data
from tablename
I have highlighted and condition. In few cases if i put and (in bold) am getting data in other cases if i put OR then am getting right data. Could someone please help me.