What I am trying to do is when the [Account Nbr] = '01-2125-000000-010000-00'
the LOBtotal should be the sum 'CM','OC','GL','Tails','Mi
ni-Tails' in the Case Statement. So I would have an LOBTotal for '01-2125-000000-010000-00'
And one for '01-2125-00PTL0-010000-00'
I tried using a Group by but it didn't work.
-- detail for Ceded Balances Payable
SELECT BatchID = 'IS4WPACP' + @ToDate
,DocNbr = 'CEDEDPREMIUM' + @ToDate
,[Account Nbr] = CASE
WHEN LOB_LOB IN ('CM','OC','GL','Tails','Mini-Tails') THEN '01-2125-000000-010000-00'
WHEN LOB_LOB = 'Claims Made Plus Prepaid Tail' THEN '01-2125-00PTL0-010000-00'
,[Description] = 'CEDEDPREMIUM'
WHERE lobtob = 'Ceded Written' AND LOB_LOB IN ('CM','OC','GL','Tails','Mini-Tails','Claims Made Plus Prepaid Tail')