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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding 2 numbers in AccessXp doesn't work...

Status
Not open for further replies.

Waxaholic

Technical User
Jan 31, 2001
63
US
I am trying to add 2 numbers in an Access database with no luck. I have no problem performing multiplication, subtraction, and division on the same numbers.

Here is what i am working with:

Attempts1 Attempts2

2 10

I created a query for the calcualtions and end results. I have tried using the following formula for the Addition of the 2 numbers above:

Result: [attempts1]+[attempts2]

This always results in a product of 210.
Can anyone enlighten me to what is going wrong here? Is there another way of achieving the same goal?

Thanks,

Wax
 
Can you check the design of the table containing the fields to be added. I would guess that one, or both, of the attempt* fields are text and not numbers. If you try to add two text strings they will simply be concatonated.

Hope this helps.
 
Indeed that was what the source data was coming in as. I used the CInt([ ]) to reformat the data to numeric so i could work with it. Worked like a charm. Hope it doesn't slow the process down. I can not modify the data source to numeric so had to stick with the mod after import. Thanks for the tip.

Wax
 
If you import the data into an existing table, Access will try to convert the data to the data types defined in the table design. As long as you ONLY have numerics in those fields then this won't cause any problems.
 
My situation is that i had someone build a text file parser for me and i think the guy passed away. He did not have the parser create the text output as numeric data but instead as text data. It writes it to an Access file overwriting any previous data. This is why i have created an Access db to link the tables and then manipulate them externally. My only choice as far as i know. I didn't want to pursue another programmer to build another parser so i am trying it this way. I cannot set table design to numeric for the linked data as it will not allow me to do that. I appreciate your help in this matter.

Waxaholic
 
You THINK he's passed away?

Man, if that's not a sign that you need to shower more often and talk to people more, I don't know what is!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top