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
{count} votes

Accepted answer
  1. Naomi 7,361 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
    

0 additional answers

Sort by: Most helpful