• Record count of Excel spreadsheet (A2K)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Record count of Excel spreadsheet (A2K)

    Author
    Topic
    #381586

    Is there a way to get the recordcount of unique records in a column of an Excel spreadsheet without importing it into Access?
    I need to know a count before I do some processing in my Access code.
    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #643816

      There are several ways. You can link to the Excel spreadsheet, either using an ODBC link or using ADO code and then do a query on that column to return a a count of the unique values in it, or you can use ADO to open that recordset on the Excel range without linking it. Here’s an example of SQL that should work in 2000 to give you a count:

      SELECT Count([customerID])
      FROM (Select distinct [CustomerID] FROM Orders);

    • #643972

      If you look in the excel board, you will find that someone wrote a neat procedure that does this in excel as well as other ways to do this in excel if you don’t want to import the data to access.

    Viewing 1 reply thread
    Reply To: Record count of Excel spreadsheet (A2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: