Count(*) or something else???

Rallen

New member
Local time
Today, 07:24
Joined
Dec 7, 2007
Messages
4
I am in the report footer of my rptCountryTotal report and need to access the total number of records in my qryDistinctCountry query. I have been wrestling with variation of Count(*) but cannot get the correct syntax. Am I on the right track or is there an easy way?
I am a novice at ACCESS and would appreciate a simple response.

Thanks
 
What happened when you put =Count(*) in the textbox?

Brian

If the report is not based on that query use Dcount.
 
Last edited:
Hi,

This should give you total number of records in the query:

SELECT Count(*) AS TotalRecs FROM qryDistinctCountry ;
 
Brian - when I enter =count(*) it gives the numer of records from rptCountryTotal and I want the number of records in qryDistinctCountry

I am not sure of the syntax and get syntax errors when entering

=Dcount FROM "[qryDistinctCountry]"

Husan
I have entered
SELECT Count(*) AS TotalRecs FROM qryDistinctCountry

and
=SELECT Count(*) AS TotalRecs FROM qryDistinctCountry

My main problem is not only knowing what function to use but also the correct syntax. Sorry if this is trying your patience but I have been attempting whatI thought should be a relatively simple operation on and off for the last month to no avail
 
The syntax of DCount is in help, a very useful tool, to access vba help where most functions reside alt+f11 to open the editor then click on help.

=DCount("*","queryname") but do read about it

Brian
 
Brian
Thanks for the tip (it was knowing to use Dcount and not count(*) which was haelpful).

Alt-f11 takes me into visual basic which I have not experimented with yet. F1 gives me online help which hopefully will enable me to progress without having to post on the forum

Roy
 
Many of the functions that you can use in queries and forms are only in VBA help not Acccess help.
Help is very useful but cannot always replace the expertise found on forums.

Cheers
Brian
 
Here's an option... in the query, select a field that will always be entered for the country and add to the query. It's ok if it's already been added previously. Then on the menu ribbon, click on the summation icon. This will add another row to the query. Then change the Group By in that row for the specific field added above and change to count. Then for every row entry it will count the number of rows. Then simply add this field into your report. You can change the display name to be Total or similar and can use as denominator in any calcualtions, etc.

:D
 

Users who are viewing this thread

Back
Top Bottom