Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在DB2中的SQL查询中使用between时添加1 day to date字段_Db2_Birt - Fatal编程技术网

在DB2中的SQL查询中使用between时添加1 day to date字段

在DB2中的SQL查询中使用between时添加1 day to date字段,db2,birt,Db2,Birt,我想知道在使用between时如何在date字段中添加1天。例如,用户将输入日期为2019年7月1日至2019年7月31日,但显示如下 and meter.readingdate between { ts '2019-01-01 00:00:00.000' } and { ts '2019-07-30 23:59:59.998' } “介于”+MXReportSqlFormat.getStartDayTimestampFunction(参数[“gprmStartDate”]) “和”+MX

我想知道在使用between时如何在date字段中添加1天。例如,用户将输入日期为2019年7月1日至2019年7月31日,但显示如下

and meter.readingdate  between { ts '2019-01-01 00:00:00.000' } and { ts '2019-07-30 23:59:59.998' } 
“介于”+MXReportSqlFormat.getStartDayTimestampFunction(参数[“gprmStartDate”])
“和”+MXReportSqlFormat.getEndDayTimestampFunction(参数[“gprmEndDate”])
如下所示

and meter.readingdate  between { ts '2019-01-01 00:00:00.000' } and { ts '2019-07-30 23:59:59.998' } 

我曾尝试使用+1天,但它不起作用。不确定在SQL查询中使用BETWEEN时如何添加1天

您可以在SQL中添加1天。例如

values TIMESTAMP( { ts '2019-01-01 00:00:00.000' } ) + 1 DAY
返回

1
---------------------
2019-01-02 00:00:00.0

使用JDBC时,是否检查birt date函数?例如BirtDateTime.addDay?首先,-您应该使用一个独占的上限(