| Taking months off sysdate [message #445051] |
Thu, 25 February 2010 08:03  |
rosswelsh
Messages: 42 Registered: February 2010 Location: Sunderland
|
Member |
|
|
Hi all I was hoping somebody could help.
I have a table called transaction_dw and I need to select all records that have an account balance that has been below 0 in the past 6 months.
The initial query I tried was:
select account_balance, timestamp
from transaction_dw
where account_balance < 0
and timestamp between sysdate and sysdate - 6;
but this is only taking 6 days off the sysdate rather than months, any idea how I can get it to take off 6 months?
Thanks very much.
|
|
|
|
|
|
|
|
|
|