Solved

Counting Number of Records for a SQL Statement

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

863 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

19 Experts available now in Live!

Get 1:1 Help Now