View Full Version : Query help, Calculating multiple Fields.


Feprincess
07-30-2007, 01:29 PM
I've imported an Excel file into a table and now I've created a Query from it.
I now need to Add Fields (names are not in the table) and calculate totals for these renamed fields some of the answers are going to be the result of two or three fields.
Any help would be greatly appreciated.
thanks

Rabbie
07-30-2007, 01:48 PM
You can always add calculated field to a query in desgn mode

Feprincess
07-30-2007, 01:56 PM
I'm trying to do that but I don't think that I have the right formula...
Is there a specific formula for adding fields?

pbaldy
07-30-2007, 02:02 PM
In the design grid:

NewFieldName: Field1 + Field2

Feprincess
07-30-2007, 02:08 PM
Thank you.
Could you give me some advice?
I have multiple fields all with different amounts in them.
Each answer will result in ten different fields starting: Student_1, Student_2.
Do I enter the name of the fields or the actual numbers. Some are minutes and some are in hours, so the hours have to be mulitplied by 60.

pbaldy
07-30-2007, 02:19 PM
You enter the name of the field, presuming you want the value from the field. You'd enter an actual number if it was constant. Thus you may have something like:

NewFieldName: HoursFieldName * 60

Feprincess
07-30-2007, 02:57 PM
Thanks so much. One more thing:
How would I set up the actual calculation?
Is it in [] or () or sum(fileld name + field name)?
thanks

pbaldy
07-30-2007, 03:10 PM
Probably the third, though if your field names have the inadvisable spaces in them, you'd have to bracket the field names. It may help if you posted the actual calculation you're trying to do.

Feprincess
07-30-2007, 03:18 PM
ok,I'm trying to calculate the total minutes for summer school attendence.
I have roughly 30 fields (three fields to calcualte per student).
So far I've just created the Query and added empty fields with Student_1 to Student_10. My description may be too confusing, I'm sorry.