Date manipulation

  • May you help to me, I want input date adding to 6 months through Stored procedure?

    example

    11/07/2008

    +6months

    11/01/2009

    how to calculate ?

    how to check leap year check and month day check 30 or 31 check

    Please sent query to me

  • Hey Vinoth,

    Try this:-

    DECLARE @Date datetime

    SET @Date = '07/11/2008'

    SET @Date = DateAdd(mm,6,@Date)

    SELECT @Date Date

  • Look up "DateAdd" in Books Online.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply