How to change Timestamp format to MM-DD-YY?

Is this possible? I have tried trunc, to_char, ::date. All of these still populate the timestamp date in the result.

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Nate ,

    It would depend on the SQL database you are using, but you should be able to do it with most databases using a CAST method. Let me know if you have any questions or if you can provide the database I can make a direct recommendation. 

    Like
    • Nate
    • Nate
    • 2 mths ago
    • Reported - view

    Jonathan Rosario Thank you! The database is Amazon Redshift which is using PostgreSQL. 

    Like
    • Nate
    • Nate
    • 2 mths ago
    • Reported - view

    I also tried CAST with no luck. 

    Like
    • kuba
    • kuba
    • 2 mths ago
    • Reported - view

    try the to_char with substring to get YY not YYYY :)

    Like
  • Hi Nate ,

     

    Here is a Stack Overflow article that might be helpful. 

    Like
Like Follow
  • 1 mth agoLast active
  • 5Replies
  • 15Views
  • 3 Following