1
votes

After a lot of R&D still not able to convert date in dd-Mon-YYYY format .am uisng open query from SSMS to oracle view but not able convert the date So reuesting you please help.

below are my query select * from openquery(oracle,'select to_char(to_date("created date",''yyyy-mm-dd''),''dd-mon-yyyy'') from Oracle View')

Data is coming the the view in below format for date 2020-10-07 00:00:000

1
Edit your question and show examples of what the the value looks like in the Oracle table. Also be clear on what you want it to look like in the query you are writing.Gordon Linoff

1 Answers

1
votes

If the date is in 'dd-Mon-YYYY' format, then it is a string. You can convert it to a date using:

select to_date(created_date, 'DD-MON-YYYY')

If you have a date in the remote table and you want to convert it to a string in this format, then use to_char():

select to_char(created_date, 'DD-MON-YYYY')