Frage

data_var := dateadd(day,1,data_var);

I'm trying this to increment one day to data_var but I keep getting this error 'identifier 'dateadd' must be declared'. I searched all around and found nothing to help me deal with this issue. Help?

War es hilfreich?

Lösung

By your mention of SQL Developer I'm going to assume you're using Oracle. If this is the case then the error makes complete sense as the function DATEADD() does not exist. It's always worth searching the documentation if you have a problem; in this instance you would have found nothing, which should have given you a clue.

To add a day to a date in Oracle simply add one to the date, i.e.:

date_var := date_var + 1;

For more information see the documentation on datetime and interval arithmetic.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top