Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AVERAGE A LIST OF YEARS

Status
Not open for further replies.

burton99

MIS
Oct 29, 2002
18
US
I am trying to find the average for a list of years pulled from a query that includes records with the year of vehicles included.

I can pull a query that will give me how many vehicles there are for each year in my query but I can't average them from there. Each time I try it tells me that it won't work because of an invalid data type.

Any help or suggestions would be great!!!

Holly
 
What app are you working in?
(if your "number of vehicles" for a given year is formatted as text, you can't average it...i.e. mathematical functions look for a #)
 
I am just trying to take a list of years and average them.

Sorry, I'm just not getting this!!

I have a query that contains only calculations based on several different queries.

Can I do the average in that same query which is based on the same records?

Thanks.
 
You still haven't told us what app you're using?
 
And...if your data, in its original form or after it is spat out of the query, is not in the appropriate format, you can't average it until you've attended to it being in the proper format...you'll continue to get "invalid data type" errors
 
So, the data type needs to be changed in the main form correct? I can't change it once it is in a query or report form, right?

Thank you very much for all your help.

Holly
 
Right. The earliest possible point to change the format is the best, but as long as it's in a mathematically calculable format when the average function hits it, you should be ok.
 
Ok...now..I want to remove a link from the table where the field lives that I need to make the change.
How do I remove the link and still be able to get into the table to make the change?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top