为什么日期函数加一天查不出来?

select DateAdd (expire_date,1,'2012-06-24'),expire_date from A 为什么查不出来
ERROR: function dateadd(timestamp with time zone, integer, unknown) does not exist
LINE 2: select DateAdd (expire_date,1,'2012-06-24'),expire_date from...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

********** 错误 **********

ERROR: function dateadd(timestamp with time zone, integer, unknown) does not exist
SQL 状态: 42883
指导建议:No function matches the given name and argument types. You might need to add explicit type casts.
字符:9

慕斯王
浏览 158回答 2
2回答

慕妹3242003

select DateAdd (expire_date,1,'2012-06-24'),expire_date from A你这个语句中第一个参数你对不对暂时还看不出,但是最后一个参数你传入的是一个字符串 ,它需要的是个日期格式.当然就不行了,需要转换,还有,如果你只是加一天的话,第一个参数固定写成day就可以

慕标琳琳

select expire_date +1,expire_date from A即可,oracle的日期能够直接相加
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server