Home Forums Data Warehousing Integration Services How to get the first day of preceding month RE: How to get the first day of preceding month
Lynn Pettis
SSC Guru
Points: 442467
More actions
February 12, 2013 at 12:48 pm
#1587172
Using T-SQL:
declare @MyDate datetime;
set @MyDate = '20121229';
select dateadd(mm, datediff(mm,cast('19000101' as datetime),@MyDate) + 1, cast('19000101' as datetime)), @MyDate;