Weird Calculation for Union Query

tempk

Registered User.
Local time
Tomorrow, 03:41
Joined
May 9, 2005
Messages
39
Hello everyone,
I have noticed something strange in my report. I have a few reports based on single queries where I use text boxes to calculate the sum of a column and a record. For column [Amount], I used =Sum([Amount]) so on and so forth. For a row, I use =[Amount]+[Expenses] to calculate the total for those two fields. It works on all my reports except for this particular one that is based on an union query. I am able to sum up columns but for rows, I get a concatenated result instead. E.g. 2,300 + 1,200 = 3,500 but I get 23001200.

What am I doing wrong? Any help would be appreciated!
 
The fields are treated as beening a string value instead of a real number (for some reason)
 
yeah..i know. Yet I am able to sum up the column?

Just don't understand why though.
 
Maybe sum() does an implicit conversion....

Try something like Cdbl()+Cdbl()...

Regards
 
CDbl is a standard access function that translates (Converts) a string to a Double.
 
alright, will try it out at work tomorrow.

thanks for sharing. weird that I couldn't find that in access help.

Something surprising everyday..
 
Good morning, it worked. You may be right that Sum() implicitly converts a string to a double. Thanks a lot!
 

Users who are viewing this thread

Back
Top Bottom