Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005
    Posts
    23

    Unanswered: Getting today date in sp?

    hi,
    How can i get today date in this format day/month/year
    (in the SP of course)

    thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Lookup the GetDate() function in Books Online.
    Dates in SQL Server are stored as a number, and are not in any particular display format. How your date is displayed is best determined by your reporting or presentation application, not SQL Server. That said, you can use CAST() and CONVERT to change your datetime value to a string value in a specified format.
    If you need just the current date, not including the time portion, then use this:
    dateadd(day, datediff(day, 0, getdate()), 0)
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •