sqlserver 查询当天的数据

当天数据:select * from tableName where datediff(day, 字段名,getdate())=0

 

本周数据:select * from tableName where datediff(week, 字段名,getdate())=0


本月:select * from tableName where datediff(month, 字段名,getdate())=0


本季度:内select * from tableName where datediff(quarter, 字段名,getdate())=0


本年:select * from tableName where datediff(year, 字段名,getdate())=0

posted @   金虹巴巴  阅读(2327)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
点击右上角即可分享
微信分享提示