t-sql date field logic
Hi Vineesh,April has only 30 days.can you try with the below query. declare @datedatetimeset @date='2010-05-01'selectsubstring(convert(varchar,dateadd(yyyy,1,@date-1),120),1,10)-------------2011-04-30...
View Articlet-sql date field logic
Hello,add one year and substract one day; but it will return 2011-04-30, because 04-31 isn't a valid date:DECLARE@datedatetime;SET@date= {dN'2010-05-01'} SELECT@date ,DATEADD(DD,-1, DATEADD(YY,...
View Articlet-sql date field logic
Hi All,I need small help ..regarding date field.....Lets say if the given date is '2010-05-01' Then I need the output as '2011-04-31'Right now I am getting output as '2011-04-01' ( used dateadd...
View Article
More Pages to Explore .....