Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT Year, 1 AS MONTH, Month1 AS MONTH_VALUE
FROM YourTable
WHERE Month1 IS NOT NULL
UNION
SELECT Year, 2 AS MONTH, Month2 AS MONTH_VALUE
FROM YourTable
WHERE Month2 IS NOT NULL
UNION
SELECT Year, 3 AS MONTH, Month3 AS MONTH_VALUE
FROM YourTable
WHERE Month3 IS NOT NULL
...
SELECT tblpivot.FYear, tblpivot.Account, tblpivot.property as FMonth, tblpivot.value as Balance
FROM (SELECT FSCSYR AS FYear, ACCTID AS Account, OPENBAL, NETPERD1, NETPERD2, NETPERD3, NETPERD4, NETPERD5, NETPERD6, NETPERD7, NETPERD8,
NETPERD9, NETPERD10, NETPERD11, NETPERD12, NETPERD13, NETPERD14, NETPERD15
FROM GLAFS
WHERE FSCSDSG = 'A' AND CURNTYPE = 'F' AND
(OPENBAL + NETPERD1 + NETPERD2 + NETPERD3 + NETPERD4 + NETPERD5 + NETPERD6 + NETPERD7 + NETPERD8 + NETPERD9 + NETPERD10 + NETPERD11
+ NETPERD12 + NETPERD13 + NETPERD14 + NETPERD15 <> 0)) t UNPIVOT (value FOR property IN (OPENBAL, NETPERD1, NETPERD2, NETPERD3,
NETPERD4, NETPERD5, NETPERD6, NETPERD7, NETPERD8, NETPERD9, NETPERD10, NETPERD11, NETPERD12, NETPERD13, NETPERD14, NETPERD15))
AS tblpivot