Forums
This topic is locked
Filtering SQL Query
27 Aug 2002 15:10:55 doug b posted:
Hi There,Any help with this would great.
I want to show records from the same recordset that are equal in value to the record currently being displayed.
Recordset1
SELECT Number
FROM TblPhone
I want to show rows from TblPhone where the 'Number' Column has the same value as the current record being displayed
(Recordset1.Fields.Item("id"

How would I set up an SQL Query to use (Recordset1.Fields.Item("id"

Thanks
Replies
Replied 28 Aug 2002 09:31:51
28 Aug 2002 09:31:51 Vince Baker replied:
Make sure the first recordset you create holds the main record from your first table.
In a second recordset filter by using a parameter and like you thought, add the following as a runtime value:
recordset1name.fields.item("NameofField"
.value
You do not have the outside brackets like you would normally.
Hope this helps
<% Response.write(The best line of code you can ever use"
%>
Vince
VBScript | ASP | HTML | SQL | Oracle | Hosting
In a second recordset filter by using a parameter and like you thought, add the following as a runtime value:
recordset1name.fields.item("NameofField"

You do not have the outside brackets like you would normally.
Hope this helps
<% Response.write(The best line of code you can ever use"

Vince
VBScript | ASP | HTML | SQL | Oracle | Hosting