Abhinav Khichar Abhinav Khichar - 1 year ago 99
SQL Question

How to convert timestamp to date in SQL?

Image: http://i.stack.imgur.com/CyyHo.jpg

I have a dataset as shown in the image. I want to use the values of created_date column as

format. How can i do that?

Answer Source

Column values does not seems to be a TimeStamp. Use the below script to make the values as datetime .

    SELECT credits,amount,city,
                  +' '+SUBSTRING(created_date,9,2)
                  +':'+RIGHT(created_date,2)) Created_Date
    FROM YourTable 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download