原文:Sql 查询当天、本周、本月记录、上周、上月记录

查询当天: select frominfowhereDateDiff dd,datetime,getdate 查询 小时内: select frominfowhereDateDiff hh,datetime,getDate lt 查询当天: select fromtablewhereDateDiff dd,datetime,getdate 本月记录 : SELECT FROM表WHEREdated ...

2019-04-02 10:17 0 545 推荐指数:

查看详情

Sql 查询当天本周本月记录

--查询当天: select * from info where DateDiff(dd,datetime,getdate())=0 --查询24小时内的: select * from info where DateDiff(hh ...

Fri Aug 21 23:51:00 CST 2015 1 36802
SQL查询当天本周本月记录详解

--查询当天: select * from info where DateDiff(dd,datetime,getdate())=0 --查询24小时内的: select * from info where DateDiff(hh ...

Tue Aug 21 18:02:00 CST 2018 0 8433
Sql Server中查询今天、昨天、本周上周本月上月数据

Sql Server中查询今天、昨天、本周上周本月上月数据 在做Sql Server开发的时候有时需要获取表中今天、昨天、本周上周本月上月等数据,这时候就需要使用DATEDIFF()函数及GetDate()函数了。DATEDIFF ( datepart , startdate ...

Wed Dec 28 18:29:00 CST 2016 0 24411
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM