Solved

Counting Number of Records for a SQL Statement

Posted on 2014-04-15
2
473 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

827 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