当前位置: 代码迷 >> Sql Server >> 查询满足数据库中两个时间字段的所有记录有关问题
  详细解决方案

查询满足数据库中两个时间字段的所有记录有关问题

热度:49   发布时间:2016-04-27 16:02:58.0
查询满足数据库中两个时间字段的所有记录问题
我在表A中设有两个时间字段(startdate和enddate)记录合同的起始和结束日期,现在页面上也输入开始时间和结束时间进行查询,SQL怎么写才把满足的条件所有的记录查出来?

------解决方案--------------------
满足什么条件?
------解决方案--------------------
晕。。。
------解决方案--------------------
declare @b datetime
set @b= '2007-01-01 '
declare @e datetime
set @e= '2007-12-01 '
Select * from 表 where StartDate> [email protected] and EndDate <[email protected]

  相关解决方案