Update Query

G

Gianna

I have an update query that no matter how I write the
expression I can not get the correct percentages. I end
up with a 100% or 0%, if a student has 4 correct answers
it should tabulate to 80%, but it calculates to 100%.
Also, all fields do populate in the table even if they are
wrong, except for the Score field, I have to run the query
once for the other fields to populate and then I have to
run the query again to get the Score field to populate.


I have a table containing the following fields:

[StudentID]
[MachineCA] - (this is where I insert # of correct
answers from students test)(5 questions total)

[Machine%] - (this field I need my update query to
populate, this field is set to a long itneger and % in
format)

[ElectricalCA] - (this is where I insert # of correct
answers from students test) (5 questions total)

[Electrical%] - (this field I need my update query to
populate, this field is set to a long itneger and % in
format)

[CorrectAnswers] - (this field needs to populate from the
update query

[Score] - (this field needs to populate from the update
query, this field is set to a long itneger and % in format)

___________________________________________________

Structure of update Query:
Field: Update To Expression:
[Machine%] [MachineCA]/5
[Electrical%] [ElectricalCA]/5
[CorrectAnswers] [MachineCA]+[ElectricalCA]
[Score] [CorrectAnswers]/10

Help....???
 
J

John Vinson

I end
up with a 100% or 0%, if a student has 4 correct answers
it should tabulate to 80%, but it calculates to 100%.

It sounds like you've defined these fields as Number... Long Integer,
the default Number type. A Long Integer, as the name implies, IS AN
INTEGER - i.e. it has no decimal places.

Change the datatype of these fields to Float in order to allow
fractional values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top