Gary Brett
asked on
Include multiple fields included in crosstab query
Is it possible at all to include multiple fields included in crosstab query? For example in below code I now have 2 fields I need to look at as below:
What I now need if possible:
Does that make any sense?
SELECT
IfNull(c.Adviser, 'GRAND TOTAL') AS Adviser,
Sum(CASE WHEN Month(i.CompDate) = 1 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) Jan,
What I now need if possible:
Sum(CASE WHEN Month(i.CompDate) = 1 THEN i.comms ELSE 0 END) OR Sum(CASE WHEN Month(i.signedupdate) = 1 THEN i.legal_fees ELSE 0 END) Jan,
Does that make any sense?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.