Sum in Row Source of Rpt

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

Guest

I have a qry using Count function so that my qry results in just one record
displaying the total records fitting the criteria specified. I then want to
use that query to generate a report (graph). I am trying to add a couple of
the fields together to get a total "other".

her is my Row Source: SELECT [CountOfQIID],Sum([CountOfQIID]) AS
[Total],Sum([EmpOther]+[EmpPropDamage]+[EmpTheft]+[EmpPolicy])AS[Other] FROM
[qryEmployee] GROUP BY [CountofQIID];

Instead of adding 3 + 0 + 0 + 0 + 0 to equal 6, my total [Other] comes out
to 3000.

Also, when formatting a graph, is there any way to "Wrap" the format axis
titles if they are too long.

THANK YOU
 
For some reason, + is treating the values in the fields as if they were
strings. Something in QryEmployee is probably causing this to happen.

Try forcing the data type with CLng or the Val function.

SUM(CLng([EmpOther]) + CLng(EmpPropDamage) + CLng(EmpTheft) +
CLng(EmpPolicy)) as [Other]
 

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