如何将列中的天数添加到DB2中的当前日期? [英] How to add Days from a column to a current Date in DB2?
本文介绍了如何将列中的天数添加到DB2中的当前日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写此sql以动态计算某些天数,如下所示。但是我不知道如何使它起作用,因为我不断收到错误消息。
I am writing this sql to dynamically calculate certain number of days as below. But I don't know how to make it work because I keep getting the error.
select Current Date + ( Dynamic numbr of days calculation here ) from TableName
通常所有指南都将示例显示为当前日期+ 1天(此方法有效但并非以上所述)我有什么想法可以使它发挥作用吗?
Usually all the guides shows examples as Current Date + 1 Day (this works but not the above) Any ideas how can I get it to work from ?
推荐答案
选择当前日期+ 动态数字来自TableName的天数
select Current Date + Dynamic numbr DAYS FROM TableName
例如
select Current Date + 15 DAYS from TableName
此处15是动态数字。
这篇关于如何将列中的天数添加到DB2中的当前日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文