Share via

Conversion for Azure SQL

Julia Pendergast 21 Reputation points
2022-05-19T19:53:54.29+00:00

I am converting Netezza queries to Azure and need help converting the following TO_CHAR statement...

SELECT DISTINCT
TDL.ORIG_SERVICE_DATE
, TO_CHAR(TDL.ORIG_SERVICE_DATE,'MM/01/YYYY')AS SERVICE_MMYY

TDL.ORIG_SERVICE_DATE pulls date and time stamp as
2022-03-30 00:00:00.000

In the Second Column (SERVICE_MMYY) I would like populate the following:
3/1/2022

I am unsure how to do this in Azure - your help is appreciated.

Azure SQL Database
0 comments No comments

Answer accepted by question author

Naomi Nosonovsky 8,906 Reputation points
2022-05-19T20:02:42.97+00:00

I think you may want :

FORMAT(TDL.ORIG_SERVICE_DATE,'M/1/yyyy') AS SERVICE_MMYY

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.