Jump to content
Sign in to follow this  
Grace

Convert Date in SQL

Recommended Posts

Date is created as an INT type in the table. How can I convert it to a Date format (dd-mm-yyyy) in my select statement? It gives an error message  "conversion failed when converting date and/or time from character string".

Share this post


Link to post
Share on other sites

is your INT unix timestamp?

Share this post


Link to post
Share on other sites

To change the data type of a column in a table, use the following syntax:

SQL Server / MS Access:

ALTER TABLE table_name
ALTER COLUMN column_name datatype;

My SQL / Oracle (prior version 10G):

ALTER TABLE table_name
MODIFY COLUMN column_name datatype;

For More information follow this link

https://www.w3schools.com/sql/sql_alter.asp

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...