Quantcast
Channel: t-sql date field logic
Browsing latest articles
Browse All 3 View Live

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 Article



t-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 Article

t-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
Browsing latest articles
Browse All 3 View Live




Latest Images