如何在 Advantage 数据库中的日期上添加 100 年
我的 Advantage 数据库中有一堆记录的结束日期为 1909 年,而不是 2009 年。如何运行更新语句来为每个日期添加 100 年? (优点是告诉我没有“str()”函数,它不会让我将月份(mydate)与“/”连接起来。
I have a bunch of records in my Advantage Database that ended up with the year 1909, rather than 2009. How can run an update statement that will add 100 years to each of these dates? (Advantage is telling me that there is no "str()" function, and it won't let me concatenate month(mydate) with "/".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用以下内容
(如果您有时间戳字段而不是日期字段,您可以省略 CAST ... AS SQL_DATE)
要连接,您必须连接字符串以更改为可以使用 CAST 或 CONVERT 的字符串
(如果您有时间戳字段而不是日期字段,您可以省略 CAST ... AS SQL_DATE,但随后您需要重新添加时间)
You could use the following
(if you have a timestamp field and not a date field you can leave out the CAST ... AS SQL_DATE)
To concatenate you must concatenate strings to change to a string you can use CAST or CONVERT
(if you have a timestamp field and not a date field you can leave out the CAST ... AS SQL_DATE, but then you need to re-add in the time)
我的 SQL 很生锈,但 Advantage Database 似乎支持 DATEADD。所以...呃...类似的事情?
My SQL is rusty but Advantage Database seems to support DATEADD. So... uh... something like this?