Incrementing one day to date in SQL Developer

柔情痞子 提交于 2020-01-16 00:55:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/20019992/incrementing-one-day-to-date-in-sql-developer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!