我想要在开始日期和结束日期之间的日期与今天的日期相关吗? [英] I want dates which are between start date and end date with repect to todays date ?

查看:93
本文介绍了我想要在开始日期和结束日期之间的日期与今天的日期相关吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想退回那些记录,如果今天的日期是在我的开始日期和结束日期之间。如果今天的日期是其中任何一个,也应该包括开始日期和结束日期。



请建议sql where子句为相同的

Hi , I want to return those records which if todays date is coming between my start date and end date. Start date and end date should also be included if my todays date is anyone of that.

Please suggest sql where clause for the same

推荐答案

取决于您使用的数据库。

例如,在SQL Server中,查询将是

Depends on the database you are using.
In SQL Server, for example, query would be
select * from tableA<br />
where tableA.col1 >= CAST(CURRENT_TIMESTAMP AS DATE)<br />
and tableA.col1 < DATEADD(DD, 1, CAST(CURRENT_TIMESTAMP AS DATE))


这篇关于我想要在开始日期和结束日期之间的日期与今天的日期相关吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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