Date Format Conversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Schief

    Date Format Conversion

    New to SQL and have a hopefully simple ???
    I have a select statement that returns a date field in the yyyy-mm-dd
    hh:mm:ss format. I would like to find a way to strip off the hh:mm:ss
    portion and return the date only.
    Thanks for the assist

  • Simon Hayes

    #2
    Re: Date Format Conversion

    See CONVERT() in Books Online:

    select CONVERT(char(10 ), getdate(), 120)

    You might also find this article useful for reference:



    Simon

    Comment

    • --CELKO--

      #3
      Re: Date Format Conversion

      You can use a proprietary CONVERT() function, or you can do the display
      formatting in the front end like you are supposed to in a tiered
      architecture.

      Comment

      • Schief

        #4
        Re: Date Format Conversion

        Thanks Simon/--Celko--

        Comment

        Working...