select operDate from RechargeRecord where datediff(month,'数据库时间字段',getdate())=3

 

 

这一句的意思是查询数据库中距现在三个月以内的数据。getdate()取得当前日期,SQL Server函数和now()一样。

具体查看:

http://www.w3school.com.cn/sql/func_datediff.asp

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-07-16
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案