Hi,
I have the following question.
I have 2 tables. When I am looping through the records from table1, I would like to have it check within table2, if the "hide" field in table 2 for the current record is set to "1", it should skip this record and move on to the next. I know I can probably do a left join, but the problem is that not all the records that are in table 1 are in table 2. Only a select few.
I have the following code.
<% sql_select_Accessory = "SELECT Accessory_Line_Id, Sku, Accessory_Item_Id, Accessory_Item_Name, Accessory_Item_Sku FROM Store_items_accessories WHERE Store_id="&Store_id&" AND Item_Id="&Item_Id %>
<% Set rs_select_Accessory = Server.CreateObject("ADODB.Recordset" %>
<% rs_select_Accessory.open sql_select_Accessory,conn_store,1,1 %>
<% rs_select_Accessory_Group.MoveFirst %>
<% Do While Not rs_select_Accessory_Group.EOF %>
<%
Item_Id = rs_select_Accessory_Group("Accessory_Item_Id"
sql_accessories2 ="SELECT * FROM accs_pricing WHERE Item_Id="&Item
Set rs_store_check = Server.CreateObject("ADODB.Recordset"
rs_store_check.open sql_accessories2,conn_store,1,1
if not rs_store_check.eof then
hide = rs_store_check("hide"
if hide = -1 then
rs_select_Accessory_Group.MoveNext 'I added this, thinking this would do the trick.
end if
%>
Here would be the loop
<% rs_select_Accessory_Group.MoveNext %>
<% Loop %>
Please let me know if the question is understandable.
Thanks
Eli
I have the following question.
I have 2 tables. When I am looping through the records from table1, I would like to have it check within table2, if the "hide" field in table 2 for the current record is set to "1", it should skip this record and move on to the next. I know I can probably do a left join, but the problem is that not all the records that are in table 1 are in table 2. Only a select few.
I have the following code.
<% sql_select_Accessory = "SELECT Accessory_Line_Id, Sku, Accessory_Item_Id, Accessory_Item_Name, Accessory_Item_Sku FROM Store_items_accessories WHERE Store_id="&Store_id&" AND Item_Id="&Item_Id %>
<% Set rs_select_Accessory = Server.CreateObject("ADODB.Recordset" %>
<% rs_select_Accessory.open sql_select_Accessory,conn_store,1,1 %>
<% rs_select_Accessory_Group.MoveFirst %>
<% Do While Not rs_select_Accessory_Group.EOF %>
<%
Item_Id = rs_select_Accessory_Group("Accessory_Item_Id"
sql_accessories2 ="SELECT * FROM accs_pricing WHERE Item_Id="&Item
Set rs_store_check = Server.CreateObject("ADODB.Recordset"
rs_store_check.open sql_accessories2,conn_store,1,1
if not rs_store_check.eof then
hide = rs_store_check("hide"
if hide = -1 then
rs_select_Accessory_Group.MoveNext 'I added this, thinking this would do the trick.
end if
%>
Here would be the loop
<% rs_select_Accessory_Group.MoveNext %>
<% Loop %>
Please let me know if the question is understandable.
Thanks
Eli