SELECT ORDER_NUM, CUSTOMER_NUM, CUSTOMER_NAME, ADD_DAYS (ORDER_DATE, 20) FROM CUSTOMER, ORDERS;
Oracle Express says ADD_DAYS invalid? Any ideas what Am I doing wrong?
Description Adding days to a date column is very simple within Oracle, you just add the number to the date and Oracle handles spanning the months (and years). Note this is for date columns, not timestamps.
Adding two dates is meaningless. You can add an interval to a date.
Use this function to add a specified number of days, months, and/or years to a date.
The ADD_MONTHS function takes a DATETIME or DATE expression as its first argument, and requires a second integer argument, specifying the number of months to add to the first argument value. The second argument can be positive or negative.
If you want to add N days to your days. You can use the plus operator as follows -
SELECT ( SYSDATE + N ) FROM DUAL;
You can use the plus operator to add days to a date.
order_date + 20
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With