--查询当天(1: select * from ShopOrder where datediff(day,ordTime,getdate()-1)=0 --查询当天(2:select * from info where DateDiff(dd,datetime,getdate())=0 --前30天 SELECT * FROM A where datediff(d,datetime,getdate()) <=30 --上一月 SELECT * FROM A WHERE DATEDIFF(m, s…