Adding columns in a query

  • Thread starter Thread starter ielmrani via AccessMonster.com
  • Start date Start date
I

ielmrani via AccessMonster.com

Hi,
this is very strange. I am trying to add 2 columns in a query but it does
not come out right.

Column1 Column2 Column3

$15.00 $30.00 $15.00$30.00

Column3 should equal $45.00.

When I subtract, divide or multiply it's fine. It does not work when i tried
to add. this is the code behind Column3: Format(nz([Column1])+nz(Column2),
"Currency")

Thanks in advance
 
It is interpreting the + as a concatenation operator. Try this
instead:

Format(Val(nz([Column1]))+Val(nz(Column2)), "Currency")
 
thank you. This one also works:
Format(CDbl(nz([Column1],0))+CDbl(nz([Column1],0)),"Currency")
It is interpreting the + as a concatenation operator. Try this
instead:

Format(Val(nz([Column1]))+Val(nz(Column2)), "Currency")

Hi,
this is very strange.  I am trying to add 2 columns in a query but it does
[quoted text clipped - 14 lines]
 
Back
Top