dks
dks

Reputation: 45

date-format-picture-ends-before-converting-entire-input-string Open Query

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

Upvotes: 1

Views: 2384

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269823

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')

Upvotes: 1

Related Questions