Skip to content
Advertisement

Tag: tsql

LAG function with two different partitions

I have a table with multiple calendars inside it and I need to get the previous business day for each row in the table. I’ve been trying to use the LAG function to achieve this but I’m unable to get the correct return for every item. I’ve ended up splitting it into two queries. When the day is a business

Advertisement