PDA

View Full Version : Solved: count records from multiple tables



john3j
09-04-2009, 02:53 PM
I am a beginner with access and was trying to count records based on different criteria from multiple tables to pull into one report. Lets say I have tables "Lates", "Obligations", and "Master". I want to be able to count the number of records that within the first column that start with the letter J from table "Lates". I also want to count all records in the fourth column of the table "Master" where the contents of that column say "Basic" in them. I need to count the number of records from table "Obligations" where column 7 contents equal "Yes". I need to be able to put all of these count numbers into one report and have no idea how to do this. If anyone could either tell me how to pull data into a report from three different tables or give me a good resource it would be greatly appreciated.

Thanks:banghead:

OBP
09-05-2009, 03:56 AM
The simplest way is to have a simple select query to do each count.
Then create a Sub Report based on each query, just showing the "Count" field and sized around it.
Then you add the 3 subreports to the Main Report where you want to display the counts, again sizing the report to only show the Count Field.

john3j
09-08-2009, 11:52 AM
Can you send me an example of one where you have done this? I would appreciate it. Though you have said how to do it, I am not sure I understand. If I could see it, I would be able to figure it out I think. Thanks!

OBP
09-09-2009, 10:42 AM
I do not currently have any examples so I created this simple database with one table, one query, a main report and a sub report based on the query.
The query "Groups" the letters (filtered to show only "j") and then counts how many are in the table.
You just need to reproduce the query/subreport for your other 2 tables