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

Access can't do subtraction?

Status
Not open for further replies.

kmclane

Technical User
Apr 14, 2004
321
US
I have a query with a calculated field that is giving incorrect results some of the time. This is from my sql statement:
Sum([totalsettleagent].[filefeectedc]-[totalsettleagent].[countofstrclosedate]) AS [Open Accounts]

In most cases it subtracts ok, but in others I get very strange results. It does 1090 - 195 = 895 fine but for 274 - 20 I get 16256?????

Perhaps I am using this incorrectly. Anybody got a hint?
Thanks, Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
Your SQL groups multiple rows together and yet your example that you cite is just one record. Is there a reason why you are using Sum()?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Ummm, I thought I had to to do "math". Are you saying I can just put filefeectedc - countofstrclosedate AS [Open Accounts], and it will work? I need to try this.
Ken


- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
I don't know why it wouldn't work.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Gee it works! You'd think that there would be something somewher to tell you the basic things like that. Thanks, Ken.

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
I did a quick search in Help (A2002) and found some decent information in "Calculations in a query"

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I'm in A97, and I saw tried that section, but it never states "format it like this:" you know, simple directions for those of us who don't know. It doesn't say exactly how to do it. The presupposition of basic knowledge is a terrible thing. ;)
Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top