henda 发表于 2018-10-23 09:29:52

使用sql语句查询日期在一周内的数据

  使用sql语句查询日期在一周内的数据
  select * from ShopOrder where datediff(week,ordTime,getdate()-1)=0   //查询当天日期在一周年的数据
  select * from ShopOrder where datediff(day,ordTime,getdate()-1)=0   //查询当天的所有数据
  SELECT * FROM A where datediff(d,datetime,getdate())
页: [1]
查看完整版本: 使用sql语句查询日期在一周内的数据