skip to Main Content

I want to store a date in this format March 13, 2014 in SQL but i couldn’t find the solution on how to store a date in this format in SQL

I tried storing it in this format March 13, 2014 but my SQL server was showing conversion issues, etc even though I used some format functions in SQL

2

Answers


  1. the only sure way to store date is in my opinion to use a converting function.

    In cas of sql- server you could use

    DATEFROMPARTS(2014, 3, 13)
    
    Login or Signup to reply.
  2. You shouldn’t provide a format date in a table, but in case you want to do it in a especific case:

        SELECT FORMAT (getdate(), 'MMM dd yyyy') as date
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search