Reputation: 59
I currently have a table, where three columns, named Start_Time, End_Time, and Scheduled_Time all have data format of Datetime where the format is YYYY-MM-DD 12:00:00 (24 hour clock). How would I be able to convert these columns where it would display as MM-DD_YYYY 12:00:00 (AM/PM) clock?
Upvotes: 0
Views: 205
Reputation: 296
I believe that if you have a table with a column such as datefield DATETIME, in your select statement, if you CAST(datefield AS VARCHAR(20)), this will give you the proper time you are looking for(AM, and PM)
Testing it out myself I went from datefield being 2014-07-30 16:44:00 to Jul 30 2014 4:44PM by using CAST()
Upvotes: 1