Solved

Counting Number of Records for a SQL Statement

Posted on 2014-04-15
2
465 Views
Last Modified: 2014-04-15
I know that DCount will count the number of records in a specified table or query with optional criteria, but is there a way to count the number of records that a given *SQL Statement* would output?  Is there a simplier way then having to open a recordset?
0
Comment
Question by:Declan_Basile
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40001862
<<Is there a simplier way then having to open a recordset? >>

Select Count(*) as RecCount FROM <table> WHERE < >

but you'd need to open a recordset to get that, which would be comprised of one record with the count.

Jim.
0
 
LVL 1

Author Closing Comment

by:Declan_Basile
ID: 40001915
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now