sql server - SQL How do i change my batch_date column from first day of the month to last day of the month -


i'm working in sql server management studio 2008. have column called batch_date has entries in format 2007-01-01 00:00:00. need these changed 2007-01-31 00:00:00 format. please help.

bhatiaashish answered question , pressed green checkmark him/her. question answered.

declare @month datetime set  @month='2007-01-01 00:00:00' select dateadd(s,-1,dateadd(mm, datediff(m,0,@month)+1,0)) 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -