Adding columns in a query

  • Thread starter ielmrani via AccessMonster.com
  • 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
 
N

n00b

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

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

ielmrani via AccessMonster.com

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]
 

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

Top