Skip to content

Normalizing an adjacency list

I have data represented in this fashion (not sure I properly call it an adjacency list, but that’s the best description I can think of): +——–+——-+ | Level | ID | +========+=======+ | …

How do I combine dateadd and convert?

I have a query that shows the month (converted from date of day): DECLARE @Month varchar(6) = ‘202101’ SELECT [Month] = CONVERT(varchar(4), YEAR(Date)) + RIGHT(’00’ + CONVERT(varchar(2), MONTH(…