How to convert a TIMESTAMP data field to a CHAR data field in SQL

5 pts.
Tags:
SQL
SQL Timestamp
How can I convert a TIMESTAMP data field to a CHAR data field?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Subhendu Sen
    It is good practice to add another char field in ur existing table with alter command. Then u can convert this timestamp (in mysql it's like: 2014-03-25 00:00:00.0) to date field in the fore end language(like java/vb/ others) what u r using now. U can drop this particular timestamp field by using this query: alter table t1 drop column c
    where t1 is ur table name and c is timestamp field name. However, I can not recommend this, insert another char field then as already said above. But whatever u do better take necessary backups of ur data then go ahead. U can see this reference here:
    http://docs.oracle.com/cd/E17952_01/refman-5.6-en/alter-table-examples.html
    27,510 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following