querry sum problem: 1+1=11

andriusaaa

New member
Local time
Today, 11:34
Joined
Jun 5, 2013
Messages
2
Hi everyone,
I have a query which is based on a couple of crosstab queries, and when i try to sum the results from those queries, the numbers adds up like this: 1+1=11.
I can`t figure it out...
I would be grateful for any advice.
 
andriusaaa, Welcome to AWF.. :)

Looks like your query is treating the fields as String.. Try wrapping them into Integer or Long and add them up..
 
pr2-eugin Thanks a lot ! worked like a charm.
Just interested - what made one of my queries start treating this column as a string.

Thanks again!
 
pr2-eugin Thanks a lot ! worked like a charm.
Just interested - what made one of my queries start treating this column as a string.
Glad you have that working.. :)

I am not entirely sure, but I myself have noticed this behavior at some point in my applications.. Specially in CrossTab queries..

One reason I was able to track down was, if you have used an Nz() function somewhere in the query this strange behavior would occur.. But that has not always been the case, TBH..
 

Users who are viewing this thread

Back
Top Bottom