Filter one recordset by another...

Results 1 to 4 of 4

Thread: Filter one recordset by another...

  1. #1
    Dan Wagoner Guest

    Default Filter one recordset by another...

    I&#039;m having some trouble with an asp function. I thought it would be easier than it is...but maybe one of you can help.<BR><BR>I have a recordset that is being filtered by customer name. Within this recordset is a numeric column called field. On the same page I have a recordset that contains a column called ID and a column called title. What I want to do is display the title by filtering the ID column by the field column. Can anyone help? I know it&#039;s a bit confusing...but I&#039;ve tried everything.<BR><BR>Thanks in advance,<BR>Dan

  2. #2
    Join Date
    Dec 1969

    Default RE: Filter one recordset by another...

    open your first recordset<BR>rsFirst.Open "SELECT * FROM table WHERE cust_Name = " & customername<BR>then<BR>open the second one<BR>rsSecond.Open "SELECT * FROM table2 WHERE ID = " & rsFirst("field")<BR>if you have many customers with the same name you can build your condition dynamicaly in a loop, adding a condition for each records in rsFirst. i hope it helps.

  3. #3
    Join Date
    Dec 1969

    Default Use only ONE recordset!

    SELECT * FROM table1, table2 <BR>WHERE table2.ID = table1.ID<BR>AND table1.customerName LIKE &#039;%Jones%&#039;<BR><BR>Never use multiple recordsets if you can help it!<BR><BR>And I *HOPE* you don&#039;t mean you are using the Recordset.Filter property. That&#039;s a very, very inefficient solution to DB problems. It should be reserved for only those times when you have really special needs that it can fulfill.<BR><BR>

  4. #4
    Dan Wagoner Guest

    Default RE: Use only ONE recordset!

    Thanks...I tried combining them before but it didn&#039;t work, so I fooled around with it some more and got it to work. THanks a lot.

Posting Permissions

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