原文:sql语句根据日期查询,本周,本月,本年,今日相关统计

昨天select from tb where datediff day, 时间字段 ,getdate 今天select from tb where datediff day, 时间字段 ,getdate 本周select from tb where datediff week, 时间字段 ,getdate 上周select from tb where datediff week, 时间字段 ,ge ...

2019-09-12 13:58 0 391 推荐指数:

查看详情

sql语句获取本周本月本年数据

本周:select * from table where datediff(week,C_CALLTIME,getdate())=0 --C_CALLTIME 为日期字段本月:select * from table where datediff(Month,C_CALLTIME ...

Wed Feb 07 20:11:00 CST 2018 0 1787
tp5 查询本年本月本周的方法

tp5自带了一些查询的方法,今天说一下查询本年本月以及本周的方法 whereTime()//此方法代替了between and 方法   实际用法如下: ->whereTime('时间字段','year')//查询本年 ->whereTime('时间字段 ...

Fri Jul 19 19:46:00 CST 2019 0 1234
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM