In our system dates are stores as mnth year eg. mnth='06' year='2005'
My problem is that I need to report back 6 months ago, which is easy enough to do except when the year changes.
what I am curretly doing is
select * from Test where mnth=to_char(sysdate,'MM')-6 and year=to_char(sysdate,'YYYY')
but when the the sysdate is 01 2006 i can use the same query..
If anyone can help it would be appreciated
My problem is that I need to report back 6 months ago, which is easy enough to do except when the year changes.
what I am curretly doing is
select * from Test where mnth=to_char(sysdate,'MM')-6 and year=to_char(sysdate,'YYYY')
but when the the sysdate is 01 2006 i can use the same query..
If anyone can help it would be appreciated