dbTalk Databases Forums  

calculate average

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


Discuss calculate average in the comp.database.ms-access forum.



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

Default calculate average - 12-03-2003 , 10:48 AM






How to get the average of more fields.
What sign to place between the fields?
For instance: average([age1]&[age2])
The sign & is not correct. Which sign is???

Laura.




Reply With Quote
  #2  
Old   
Bradley
 
Posts: n/a

Default Re: calculate average - 12-03-2003 , 03:21 PM






"Laura Eekels" <laura.eekels (AT) xx (DOT) yy> wrote

Quote:
How to get the average of more fields.
What sign to place between the fields?
For instance: average([age1]&[age2])
The sign & is not correct. Which sign is???

Laura.
Avg([Field1] + [Field2] + [Field2])

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response




Reply With Quote
  #3  
Old   
Laura Eekels
 
Posts: n/a

Default Re: calculate average - 12-07-2003 , 11:14 AM



Thanks for the answer, but I tried that already. and it doesn't work.
Avg([field1]+[field2]) field1=7;field2=8 gives the result 78 and not the
average !?!
Do you have any other suggestions?
Laura

"Bradley" <bradley (AT) REMOVETHIScomcen (DOT) com.au> schreef in bericht
news:jtszb.38208$aT.14986 (AT) news-server (DOT) bigpond.net.au...
Quote:
"Laura Eekels" <laura.eekels (AT) xx (DOT) yy> wrote in message
news:3fce13ec$0$214$e4fe514c (AT) news (DOT) xs4all.nl...
How to get the average of more fields.
What sign to place between the fields?
For instance: average([age1]&[age2])
The sign & is not correct. Which sign is???

Laura.

Avg([Field1] + [Field2] + [Field2])

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response





Reply With Quote
  #4  
Old   
Bradley
 
Posts: n/a

Default Re: calculate average - 12-09-2003 , 02:33 PM



I didn't understand what you were asking...

Are you wanting to find the average of all the values in Field1 and Field2
in your table? I think you'd need to somehow collate the values into a
single field perhaps using a few queries to add values to a temp table.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response


"Laura Eekels" <laura.eekels (AT) xx (DOT) yy> wrote

Quote:
Thanks for the answer, but I tried that already. and it doesn't work.
Avg([field1]+[field2]) field1=7;field2=8 gives the result 78 and not
the
average !?!
Do you have any other suggestions?
Laura

"Bradley" <bradley (AT) REMOVETHIScomcen (DOT) com.au> schreef in bericht
news:jtszb.38208$aT.14986 (AT) news-server (DOT) bigpond.net.au...
"Laura Eekels" <laura.eekels (AT) xx (DOT) yy> wrote in message
news:3fce13ec$0$214$e4fe514c (AT) news (DOT) xs4all.nl...
How to get the average of more fields.
What sign to place between the fields?
For instance: average([age1]&[age2])
The sign & is not correct. Which sign is???

Laura.

Avg([Field1] + [Field2] + [Field2])

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response







Reply With Quote
  #5  
Old   
Ray
 
Posts: n/a

Default Re: calculate average - 12-10-2003 , 03:35 AM



"Laura Eekels" <laura.eekels (AT) xx (DOT) yy> wrote

Quote:
How to get the average of more fields.
What sign to place between the fields?
For instance: average([age1]&[age2])
The sign & is not correct. Which sign is???

Laura.
Hello Laura,

I believe what your looking for is to put the following
into your query like this:

Average: ([Field1]+[Field2]+[Field3])/3

You'll notice that the number of fields used determines
the number to divide by. Access doesn't like the Avg()
function to be used within the query. So, the number of
fields you want to get an average for will determine the
number to divided them by.

The end result, I presume, will be displayed as the last
field in your query which will display the result for
each record.

Regards,

Ray


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.