Hi I need the value in 'Needed' column, logic is provided below
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Lookup up the LAG function (teaching someone how to fish) if you're using at least SQL Server 2012. Actually, here's the link ...
18 People are following this question.
Deciphering SQL code
ACCESS ERROR - object invalid or no longer set
Current total per year
Generating groupID in Tsql