Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Where clause

Author  Topic 

JJ297
Aged Yak Warrior

940 Posts

Posted - 2011-06-07 : 15:24:01
What is this saying it is doing?

where (dateadd(mm, -13, getdate()) < mnth_endt)

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-07 : 15:43:43
(dateadd(mm, -13, getdate()) finds the date and time exactly 13 months ago. So right now at 2011-06-07 15:41:55.210, that will return 2010-05-07 15:41:55.210. So then the where clause is checking whether mnth_endt is later than that. That is, whether mnth_endt is within 13 months from now.
Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2011-06-07 : 16:04:03
Great thanks!
Go to Top of Page
   

- Advertisement -