前言
需求:需要在数据库中根据当前时间,获取近1月(近30天)、近3月(近90天)、近6月(近180天)的数据,返回给前台。
具体脚本
近1月(近30天)
方式1:
select field1,field2 from tablename where datediff(dd,DTime,GETDATE())<=30
方式2:
select field1,field2 from tablename where DTime>dateadd(mm,-1,getdate())
近3月(近90天)
方式1:
select field1,field2 from tablename where datediff(dd,field,GETDATE())<=60
方式2:
select field1,field2 from tablename where DTime>dateadd(mm,-3,getdate())
近6月(近180天)
方式1:
select field1,field2 from tablename where datediff(dd,field,GETDATE())<=180
方式2:
select field1,field2 from tablename where DTime>dateadd(mm,-6,getdate())
Wow, awesome weblog structure! How long have
you been blogging for? you make running a blog glance easy.
The entire glance of your site is magnificent, let alone the content!
You can see similar here e-commerce
Wow, wonderful weblog structure! How lengthy have you been running a blog for?
you make running a blog glance easy. The whole look of your site is excellent, let alone the content
material! You can see similar here najlepszy sklep
Wow, marvelous blog format! How long have you been running a blog for?
you made running a blog look easy. The whole glance of your
site is great, let alone the content! You can see similar here dobry sklep
Monitor phone from anywhere and see what’s happening on target phone. You will be able to monitor and store call logs, messages, social activities , images , videos, whatsapp and more. Real-time monitoring of phones, No technical knowledge is required, no root is required.