Add Text Field Columns

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

PFDB: IIf(Nz([PFDirect])+Nz([PFBulk])=0,"",Nz([PFBulk])+Nz([PFDirect]))

I have two fields both of which are text. When I try to add them as above, I get a
concatenated result, not the sum. How does one add them?

--
 
PFDB: IIf(Nz([PFDirect])+Nz([PFBulk])=0,"",Nz([PFBulk])+Nz([PFDirect]))

I have two fields both of which are text. When I try to add them as above, I get a
concatenated result, not the sum. How does one add them?

How does one add "This is text." + "this is also text"?
If both fields are Text, then your expression will concatenate them.

One adds numbers.
Now if the values within the text datatype fields are actually
numbers (0 - 9) as text, then you can try:

PFDB:
IIf(Nz(Val([PFDirect]),0)+Nz(Val([PFBulk]),0)=0,"",Nz(Val([PFBulk]),0)+Nz(Val([PFDirect]),0))
 
Oh, thanks Fredg..
VAL is where it's at. I should have know this.

fredg said:
PFDB: IIf(Nz([PFDirect])+Nz([PFBulk])=0,"",Nz([PFBulk])+Nz([PFDirect]))

I have two fields both of which are text. When I try to add them as above, I get a
concatenated result, not the sum. How does one add them?

How does one add "This is text." + "this is also text"?
If both fields are Text, then your expression will concatenate them.

One adds numbers.
Now if the values within the text datatype fields are actually
numbers (0 - 9) as text, then you can try:

PFDB:
IIf(Nz(Val([PFDirect]),0)+Nz(Val([PFBulk]),0)=0,"",Nz(Val([PFBulk]),0)+Nz(Val([PFDirect]),0))
 

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