the query looks like this
select max(DECODE(STA,2,RD,NULL)) "MW_Previous",
max(DECODE(STA,5,RD,NULL)) "MV_Previous",
max(DECODE(STA,8,RD,NULL)) "P2300-3 Previous",
max(DECODE(STA,11,RD,NULL)) "P2300-4 Previous"
from history where tour=18 and dt={?SelectDate}-1 and shift_no=(select max(shift_no) from history where tour=18 and rev_no=1 and dt={?SelectDate}-1)
it works perfect and gives the previous day value.
what do i have to do to get values of 2 days back or may be 3 days back or may be 7 days back and so on?
Thanks
select max(DECODE(STA,2,RD,NULL)) "MW_Previous",
max(DECODE(STA,5,RD,NULL)) "MV_Previous",
max(DECODE(STA,8,RD,NULL)) "P2300-3 Previous",
max(DECODE(STA,11,RD,NULL)) "P2300-4 Previous"
from history where tour=18 and dt={?SelectDate}-1 and shift_no=(select max(shift_no) from history where tour=18 and rev_no=1 and dt={?SelectDate}-1)
it works perfect and gives the previous day value.
what do i have to do to get values of 2 days back or may be 3 days back or may be 7 days back and so on?
Thanks