Skip to Content
0
Former Member
Jan 20, 2011 at 10:31 AM

Q31: How to select only sum totals greater then zero

253 Views

Try as I might I cannot get the 'Where' statement to accept text selecting only Invoiced Value greater than zero, it does not like the 'sum' part of the calculation - any ideas?

SELECT

t0.cardcode as 'Customer Code',

t0.cardname as 'Customer name',

sum(t0.doctotal-t0.vatsum) as 'Invoiced Value'

FROM

oinv t0

inner join ocrd t1 on t0.cardcode = t1.cardcode

WHERE

t0.docdate between [%1] and [%2]

GROUP BY

t0.cardcode,

t0.cardname

ORDER BY

t0.cardcode

Thanks,

Robin