I have the below Query and I want the Ageing profile to show as a new column my ageing profile is 0-30, 31-60, 61-90, 91-120, 121-180, 181-365, 365+
I basically want the results to appear lie this with the Net due appearing in the appropriate ageing bracket.
BU 0-30 31-60 61-90 91-120 121-180 181-365 365+
--------------------------------------------------------------
A
B
C
Query:
select
BU,
Ageing,
sum(NetDue) as Netdue
from [dbo].[vw_FACT_CONSOL_CREDITORS]
where date = @date
Group by BU, Ageing
Order by BU ;
I am new to SQL and just trying to learn so apologise as this is basic stuff Thanks