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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access - Count/ Subtotal

Status
Not open for further replies.

Livia8

Technical User
Oct 29, 2003
130
IE
Hi there,

I must start by saying that I know basically nothing of Access (I can barely add new rows and sort them alphabetically). I have a database that contains on one column the names of car models, and on another the locations where those cars are located. How would I go about adding a calculation at the bottom that would tell me how many cars I have on each location? (For instance, how many Ladas I have in Russia and how many Fiat I have in Italy?). At the end of this, I'd like to be able to run a report by car type and location.
One more thing: exporting to Excel is not an option.

As I said, I'm completely useless at this, so I'd be grateful for a step-by-step guide.

Many thanks,

Livia

PS: I've tried the help function but I'm probably asking the wrong question.
 
You need a count query with a group by cartype.

Basically, right click ur query, go to SQL mode, then you will need to type the following

SELECT TableName.CarLocation, Count(TableName.CarModel) (or rowCount, not sure)
FROM TableName
Group By Tablename.CarLocation;

Note that if you have names with spaces, you will need to add [] to define the name
 
Sorry hit submit too fast, That is to know how many MODELS you have per location, for the number of car, it would be

SELECT TableName.CarLocation, Sum(TableName.CarModel)
FROM TableName
Group By Tablename.CarLocation;
 
Hi there,

Sorry for not getting back to you sooner but I had to put this database aside until now.

Thank you very much for your help.

Regards,

Livia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top