jo112358 jo112358 - 1 year ago 51
SQL Question

how do I convert a date to YYYYMMDD?

I have two tables with two different date formats and I need to compare them. I am trying to convert the field Q_RATE_DATE; how do I change it from


I tried:


no luck, what am I doing wrong?

jdg jdg
Answer Source

To render as text:


To reconvert that text back to date:


Editing based on Alex Poole's excellent comment. If you find that one date is stored as a string while the other is a date, you may need to use a mix of the above two queries.

To convert the text string into date:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download