如何将列中的天数添加到 DB2 中的当前日期? [英] How to add Days from a column to a current Date in DB2?

查看:14
本文介绍了如何将列中的天数添加到 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 ?

推荐答案

选择当前日期 + 动态数字 DAYS FROM TableName

select Current Date + Dynamic numbr DAYS FROM TableName

例如

select Current Date + 15 DAYS  from TableName

这里 15 是动态数字.

here 15 is dynamic number.

这篇关于如何将列中的天数添加到 DB2 中的当前日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆