SELECT L4, L3, L5, IIf([sum(DR)]>[sum(CR)],[sum(DR)]-[sum(CR)],0), IIf([sum(CR)]>[sum(DR)],[sum(CR)]-[sum(DR)],0)
FROM GL
WHERE L4 not in (0)
GROUP BY L4, L3, L5;
This is the code that isnt working, asking for parameters of "sum(dr)".
What i basically want is, to net the fields DR and CR first and then summation it according to codes. Thank you.