Hi
I have a line of code which works ok
CAST(DATEPART(qq, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) + ' - '+ CAST(DATEPART(yy, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) AS QTRYEAR
This gives me the result 4 - 2023 however I would like it to look like Q4 - 2023
I have tried to add the Q in like this and other variations, probably not the right way to do it , but get result like 4Q - 2023
CAST(DATEPART(qq, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) + 'Q'+ ' - ' + CAST(DATEPART(yy, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) AS QTRYEAR,
Any advice would be appreciated.
Thanks
I have a line of code which works ok
CAST(DATEPART(qq, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) + ' - '+ CAST(DATEPART(yy, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) AS QTRYEAR
This gives me the result 4 - 2023 however I would like it to look like Q4 - 2023
I have tried to add the Q in like this and other variations, probably not the right way to do it , but get result like 4Q - 2023
CAST(DATEPART(qq, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) + 'Q'+ ' - ' + CAST(DATEPART(yy, dbo.JourneyHeader.JourneyDate) AS VARCHAR(4)) AS QTRYEAR,
Any advice would be appreciated.
Thanks