Subtract 14 days from system date

时间:2018-06-04 16:56:58

标签: sql oracle sap

I am using the following code to give me the system date in BODS, to_char(sysdate(),'YYYYMMDDHHMISS'), I have the system date returning correctly, but am unable to subtract days.

FAGLFLEXA.TIMESTAMP >= "MISSING CODE HERE" and FAGLFLEXA.TIMESTAMP <= to_char(sysdate(),'YYYYMMDDHHMISS')

1 个答案:

答案 0 :(得分:2)

You can subtract days from a date by subtracting a whole number. Also, for some reason you are using sysdate() which is not proper Oracle format.

to_char(sysdate-14,'YYYYMMDDHHMISS')