TOTALS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

IM TRYING TO BUILD AN EXPRESSION TO RETRIEVE TOTALS. HERES MY DELEMA I HAVE A
FIELD IN MY TABLE CALLED "CHARGES" THAT HAS NEGATIVE AND POSITIVE AMOUNTS, I
WANT TO RUN A QUERIE THAT WILL RETRIEVE THE TOTAL OF THE NEGATIVE AMOUNTS
ONLY. WHAT IS THE CORRECT STRING. THANK YOU
 
use an iif expression
select sum(iif(charges<0,charges*-1,0)) from yourtable;
 
Try this:
SELECT Sum(CHARGES) AS SumOFCHARGES
FROM TableName
WHERE CHARGES<0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top