dbTalk Databases Forums  

Strange errors when calculating a total

comp.database.ms-access comp.database.ms-access


Discuss Strange errors when calculating a total in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chps
 
Posts: n/a

Default Strange errors when calculating a total - 04-18-2004 , 03:23 PM






Hello all
I have written an Access database for the purpose of monitoring pupil
progress in school where staff enter data through an intranet. The records
are filtered according to teaching group. One of the calculations involves
totaling the National Curriculum levels for individual tests,using lookup
tables to convert a mark to an NC level.
The problem is that very occasionally some, but not all records, produce an
error instead of the total. Those records producing errors being from one
teaching group whenever the problem arises.
I have found that I can clear the error by altering the sequence of addition
in the query from say

Nz([Test1NC],0)+Nz([Test2NC],0)+Nz([Test3NC],0) AS NCTotal, - to
Nz([Test2NC],0)+Nz([Test2NC],0)+Nz([Test1NC],0) AS NCTotal,

Does anyone know what causes the problem and how it can be avoided please?



Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: Strange errors when calculating a total - 04-18-2004 , 03:42 PM






What is the data type of Test1NC, etc.?
Should be vairiant.
On Sun, 18 Apr 2004 21:23:40 +0100, "chps" <chps (AT) chps (DOT) karoo.co.uk>
wrote:

Quote:
Hello all
I have written an Access database for the purpose of monitoring pupil
progress in school where staff enter data through an intranet. The records
are filtered according to teaching group. One of the calculations involves
totaling the National Curriculum levels for individual tests,using lookup
tables to convert a mark to an NC level.
The problem is that very occasionally some, but not all records, produce an
error instead of the total. Those records producing errors being from one
teaching group whenever the problem arises.
I have found that I can clear the error by altering the sequence of addition
in the query from say

Nz([Test1NC],0)+Nz([Test2NC],0)+Nz([Test3NC],0) AS NCTotal, - to
Nz([Test2NC],0)+Nz([Test2NC],0)+Nz([Test1NC],0) AS NCTotal,

Does anyone know what causes the problem and how it can be avoided please?



Reply With Quote
  #3  
Old   
chps
 
Posts: n/a

Default Re: Strange errors when calculating a total - 04-28-2004 , 03:26 PM



Thanks for the reply the Test1NC comes from a lookup table using the
following code
IIf([Y09T1]>-1,DLookUp("[1]","[TScLUY09NCnum]","Test_Mark = " & [Y09T1])) AS
Test1NC,
The lookup table consists of a number of fields corresponding to the
different tests. Each test mark is allocated a National Curriculum level
as a double for each test. Test1NC 'picks up' this double.


"Ira Solomon" <isolomon (AT) solomonltd (DOT) com> wrote

Quote:
What is the data type of Test1NC, etc.?
Should be vairiant.
On Sun, 18 Apr 2004 21:23:40 +0100, "chps" <chps (AT) chps (DOT) karoo.co.uk
wrote:

Hello all
I have written an Access database for the purpose of monitoring pupil
progress in school where staff enter data through an intranet. The
records
are filtered according to teaching group. One of the calculations
involves
totaling the National Curriculum levels for individual tests,using lookup
tables to convert a mark to an NC level.
The problem is that very occasionally some, but not all records, produce
an
error instead of the total. Those records producing errors being from
one
teaching group whenever the problem arises.
I have found that I can clear the error by altering the sequence of
addition
in the query from say

Nz([Test1NC],0)+Nz([Test2NC],0)+Nz([Test3NC],0) AS NCTotal, - to
Nz([Test2NC],0)+Nz([Test2NC],0)+Nz([Test1NC],0) AS NCTotal,

Does anyone know what causes the problem and how it can be avoided
please?





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.