+ Reply to Thread
Results 1 to 5 of 5

SQL Query to Count Results in Recordset

  1. #1
    Registered User
    Join Date
    03-24-2010
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    27

    SQL Query to Count Results in Recordset

    I've been using this code for a while to retrieve data from an access database. I now need to count the number of records in the set before I write the data. I'm aware I could count the records by adding a count to the loop below, but I want to change the way this the whole thing works! I want to import my data to an array, so I would need to redim the array first. I have tried writing an SQL query that counts but I can't get thing thing to work. Can I build it into the query below? I'm actually extremely confused about how the whole thing works :|...



    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: SQL Query to Count Results in Recordset

    Hi -

    Try;
    Please Login or Register  to view this content.
    Regards,
    event

  3. #3
    Registered User
    Join Date
    03-24-2010
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: SQL Query to Count Results in Recordset

    Ok I guess that's correct way to query query, but I didn't understand how to use that query to get the number of the results to, lets say, a variable that I can use? I just don't get it.

  4. #4
    Registered User
    Join Date
    03-24-2010
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: SQL Query to Count Results in Recordset

    I tried to run this query and send the result to a variable (var = query..) and that does not work. Any ideas?

  5. #5
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: SQL Query to Count Results in Recordset

    Please Login or Register  to view this content.
    Try (untested).

    Regards,
    event

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1