Results 1 to 2 of 2

Thread: Record.Count

  1. #1
    Join Date
    Dec 1969

    Default Record.Count

    I want to use this (lengthy) code I wrote and also get the total number of products that were queried.<BR><BR>How can this code be shortened plus add a total number of records that are found to match both PR_Category And PR_Keywords ?<BR><BR><BR>sSql = "SELECT PRODUCTS.PR_ProductCategory, PRODUCTS_OTHER.PR_Date, PRODUCTS_OTHER.PR_SKU " _<BR>& "FROM PRODUCTS_OTHER INNER JOIN PRODUCTS ON PRODUCTS_OTHER.PR_SKU = PRODUCTS.PR_SKU " _<BR>& "WHERE PR_ProductCategory = &#039;GARM&#039; OR PR_ProductCategory = &#039;MAGE&#039; AND PR_Keywords = &#039;Handheld GPS&#039; OR PR_Keywords = &#039;Mobile GPS&#039; OR PR_Keywords = &#039;Marine GPS&#039; OR PR_Keywords = &#039;Fixed Mount GPS&#039;" _<BR>& "ORDER BY PRODUCTS_OTHER.PR_Date DESC"<BR><BR>rs.Open sSql, conn, 1, 3, 0<BR>productid= rs("PR_SKU")<BR>rs.MoveNext<BR>productid2= rs("PR_SKU")<BR>rs.MoveNext<BR>productid3= rs("PR_SKU")<BR>rs.MoveNext<BR>productid4= rs("PR_SKU")<BR>rs.Close<BR><BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Record.Count

    You can use the Recordset.Recordcount property to get the num records. FYI, this requires and a scrollable cursor.

Posting Permissions

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