Difference between Datediff('DD') & Datediff('D')

  • Hi All,

    I am using DateDiff function to find out the difference in number of days between 2 dates. [select Datediff(DD, '2009-02-10', getdate())]

    I get same answer when I use 'D' in place of 'DD'. I would like to know what's the diff between 'D' & 'DD' ?

    Regards,

    swmsan

  • both are identical.

    refer BOL.

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f1a5bc-4c0c-4c48-848d-8ec03473e6c1.htm



    Pradeep Singh

  • swmsan (2/18/2009)


    Hi All,

    I am using DateDiff function to find out the difference in number of days between 2 dates. [select Datediff(DD, '2009-02-10', getdate())]

    I get same answer when I use 'D' in place of 'DD'. I would like to know what's the diff between 'D' & 'DD' ?

    Regards,

    swmsan

    Use day in place of DD or D for clarity


    Madhivanan

    Failing to plan is Planning to fail

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

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