473,411 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

URGENT: Error in Summing Values in a Query!

121 100+
I Know I've posted an Urgent message before. But I'm in the middle of system testing, and these little stupid bugs are killing me......


I have a query that checks that a set of values (the values in 6 fields) are actually equal to the total they submitted on the form.

The fields are set to Double with Auto for # decimal places. But I've also tried it with them set to 2-Decimal places.


The SQL query looks like this:
Expand|Select|Wrap|Line Numbers
  1. UPDATE ETL_TBL SET ETL_TBL.ERR_CD = "802"
  2. WHERE (((ETL_TBL.SPEKR_TOTL_AMT)<>([SPEKR_Fee_AMT]+[SPEKR_Air_AMT]+[SPEKR_HTL_AMT]+[SPEKR_Taxi_AMT]+[SPEKR_PRMN_AMT]+[SPEKR_OTHR_AMT])) AND ((ETL_TBL.OVRD_VALDN_IND)=No) AND ((ETL_TBL.VALD_STA_IND)=No));
The Criteria I put in the Access design view is:
Expand|Select|Wrap|Line Numbers
  1. <>([SPEKR_Fee_AMT]+[SPEKR_Air_AMT]+[SPEKR_HTL_AMT]+[SPEKR_Taxi_AMT]+[SPEKR_PRMN_AMT]+[SPEKR_OTHR_AMT])
Now on some of my records - (and I stress some - because not every record is giving me the error), the query says that the totals are incorrect. even though they look right. The fact it only does it on some is killing me even more!

Is there a reason this might be? Is there a different way to do this? Is there some other way to check?


Thanks for any help I can get ASAP!
May 4 '07 #1
2 1618
JHNielson
121 100+
Well I solved it, so I just thought I would share the answer in case anyone else had this problem.

Basically I came to realize that Access was seeing these numbers as much more detail than simply to the second decimal. So the numbers were never perfectly matching out to the nth decimal.

So I but the criteria as Round([...],2)<>Round([...]+[...]+[...]),2

And that worked...
May 4 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Well I solved it, so I just thought I would share the answer in case anyone else had this problem.

Basically I came to realize that Access was seeing these numbers as much more detail than simply to the second decimal. So the numbers were never perfectly matching out to the nth decimal.

So I but the criteria as Round([...],2)<>Round([...]+[...]+[...]),2

And that worked...
Glad you got it sorted. Sorry I wasn't around when you posted. Testing time is fun. :)

Mary
May 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Yaroslav Bulatov | last post by:
I made an array of 10 million floats timed how long it takes to sum the elements, here's what I got (millis): gcc -O2: 21 Python with numarray: 104 Python with Numeric: 302...
7
by: (Pete Cresswell) | last post by:
I posted this in the MS Access group, but no luck. ------------------------------------------ I've got another stored procedure in the same app that returns multiple recordsets and the code works....
5
by: Jean Christophe Avard | last post by:
Hi! I have a query that INNER JOIN's three other tables. All the relation are 1 to 1, except for one, where an Item can have more than one price. I have this query that work fine in MSDE Query...
10
PEB
by: PEB | last post by:
When I try to add by action query the sum of the previous values in the recordset - the sum isn't correct I want table like this named Test: Field1, MySumField Test, 1 Test, 2 Test, 3...
4
by: Lori2836 via AccessMonster.com | last post by:
I have a query where I am grouping by Fiscal Month, Summing # of Quotes, Summing # of Days.......and created an expression.........Avg Days: /. And I get the following error...
12
by: neeraj | last post by:
Hi Can any body give me the syntax for summing the elements of the an array , without looping thanks
4
by: dancole42 | last post by:
So I have an invoicing database based on two main forms: Orders and OrderLines. Orders has fields like: OrderID BillingMethod OrderDate CreditCard CCExp OrdSubTotal ShippingCharge
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
5
by: gopim | last post by:
strSql = "SELECT ISNULL(max(substring(User_ID,2,len(User_ID))) + 1,'100') FROM Users"; sqlCmd.CommandText = strSql; sqlDr = sqlCmd.ExecuteReader(); ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.