June 3, 2009 at 3:04 pm
Been trying to figure this out... what exactly are the date calculations doing in the code below:
select join_date from company where join_date <= convert(varchar(10),(dateadd(day, -1*day(dateadd(month, 0 ,getdate())),dateadd(month, 0 , getdate()))),101) Thanks. Rog
June 3, 2009 at 3:06 pm
select convert(varchar(10),(dateadd(day, -1*day(dateadd(month, 0 ,getdate())),dateadd(month, 0 , getdate()))),101)
--results:
05/31/2009
it is finding the last day of the month prior to today. then of course it's find data in your table that is earlier than that.
Lowell
June 3, 2009 at 3:12 pm
Thank you!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply