sql queries

  • i need nearest saturday from the current date, please tell the answer.

    nani

  • please read and follow the instructions given in the first link in my signature.

    You might also search either this site or Google for a solution. This is a rather common question.

    But to answer your question at the same level: You need to use DATEDIFF() with the proper arguments. 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • So what's the question?

  • FLOOR(DATEDIFF(day, DateOfBirth, GETDATE()) / 365.25)

  • sungiri88 (1/22/2011)


    FLOOR(DATEDIFF(day, DateOfBirth, GETDATE()) / 365.25)

    What is the with the division? The question was to display the age in days:

    datediff(dd, dob, getdate())) -- How many days between now and the date of birth.

  • thank you friend for ur help.

    nani

Viewing 6 posts - 1 through 6 (of 6 total)

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