数据类型 datetime
比如有2015年全年的数据,我想查询从2015年8月开始至今的数据,应该怎么表达。
------解决思路----------------------
-- 到分秒的话,在时间后写就可以了,如果没有写默认是 00:00:00
select?*?from?t
?where?cdate?between?'2015-08-01 12:05:13'?and?getdate()
------解决思路----------------------
--try this
select * from t
where cdate between '2015-07-31 23:59:59' and convert(varchar(100),getdate(),120)