jgozal jgozal - 2 years ago 97
SQL Question

Translating line from sql server to oracle

I am slightly confused with the way to_char works in oracle. How would you translate this sql server line into oracle?

cast(month(date) as varchar)+'/'+cast(day(date) as varchar)+'/'+cast(year(date) as varchar)

Answer Source

Just use this:

select to_char(date_column,'MM/dd/yyyy') from your_table;

You should read more about to_char in oracle docs or techonthenet. It's not to hard to understand.

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