Hi @RAVI
Try this:
DECLARE @Test table(Order_Recieved_Month VARCHAR(20))
INSERT INTO @Test VALUES ('01-09-2022 00:00'),('01-10-2022 00:00')
--1
SELECT LEFT(DATENAME(MONTH,FORMAT(CAST(Order_Recieved_Month AS DATE),'dd/MM/yyyy')),3)+'-'+RIGHT(DATENAME(YEAR,Order_Recieved_Month),2) AS mm_yy
FROM @Test
--2
SELECT FORMAT(CONVERT(date, Order_Recieved_Month,103),'MMM-yy') AS mm_yy
FROM @Test
Refer to this blog for more examples of FORMAT: Format SQL Server Dates with FORMAT Function
Output:
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.