I am normally able to figure this stuff out on my own, but I can't seem to get the logic for a SQL pivot.
Here is what I have in Access:
Which outputs like this:
RptDate Plan1 Plan2
2019-08-25 $436.00 $4,255.24
2019-08-24 $1,167.38 $4,965.16
Can anyone SQLize this? I'm too embarassed to post what I have been trying to do in SQL, it looks like a pile of dog crap.
Here is what I have in Access:
Code:
TRANSFORM Sum(Table.PaymentAmt) AS Amt
SELECT RptDate
FROM Table
GROUP BY Table.RptDate
ORDER BY Table.RptDate DESC
PIVOT Table.PlanType;
Which outputs like this:
RptDate Plan1 Plan2
2019-08-25 $436.00 $4,255.24
2019-08-24 $1,167.38 $4,965.16
Can anyone SQLize this? I'm too embarassed to post what I have been trying to do in SQL, it looks like a pile of dog crap.