Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding two column's

Status
Not open for further replies.
Jul 4, 2004
42
GB
Hello.

I have three columns.

"Below98","above98" and "result:[Below98]+[above98]".

The first two columns contain figures which I wish to ADD togther as a sum and display in result. i.e.[25]+[25] =[50].

What I get in the "result:[Below98]+[above98]" column is 2525.

If I change the + to * I get 625 which is correct. So how do I get the sum of the columes to add togther?


Thanks in advance.

 
Access sees them as strings - they are probably defined that way in the underlying table, so they are concatenated by default. To add strings, first convert them. One way:
Code:
result: val([Below98])+val([above98])

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
In addition, I would consider fields with names like Below98 and Above98 to be un-normalized.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top