Full Version: Access (2007) Query Using Count Function
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
CLupico
My apologies if this particular post is redundant, I’ve searched for similar ones with no luck.

My problem is fairly simple. I’ve got a Real Estate DB consisting of 2 tables: an Agents Table (Agent ID Primary Key) and additional Agent Info. I’ve also got a Properties Table consisting of the (Property ID Primary Key) and the Agent ID as a foreign key) along with related property characteristics including the Selling Price. Both tables have been joined through the Agents ID.

I’ve been attempting to Count the number of properties with a Selling Price in excess of $250000. I’ve used the >250000 on the criteria line for the Selling Price field and have applied the “Count” feature to the PID and the Selling Price both separately and together to no avail. Any assistance would be most appreciated. Thanks!
mike60smart
Hi

Your query will allow you to use the >25000 to filter the records required

To actually Count the nr of records you will need to Create a Report based on the Query and then use the Count Function


Hope this helps

Mike
KimbleG
Hi,
To continue with Mike's reply, the COUNT query should be very straight forward and easy. If as you say it is not working, then maybe there are a couple of things to look at.
First (to keep it simple) create a query with 2 fields in it
PropertyID, Selling Price (I assume selling price is a Currency field...? If not then it needs to be.)

The SQL will look like this

SELECT Count([tblProperty].PropertyID) AS CountOfPropertyID
FROM tblProperty
WHERE ((([tblProperty].[Selling Price])>250000));

This SQL will return the correct count.

KG
CLupico
Mike,
It worked like a "charm".Thanks again.
Chuck
mike60smart
Hi Chuck

Glad to help

Mike
uarulez2.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.