Forums

ASP

This topic is locked

Duplicate Data Problem

Posted 14 Jul 2006 20:12:05
1
has voted
14 Jul 2006 20:12:05 jay mr posted:
Hey Gang,

Need some help.

I have a table that keeps a list of locations or stores. Some of the stores are in the same city and state.

My goal is create a list (either in a dynamic jump menu or table) that the website visitor will click on and be passed on to page that gives them the stores in their city or state.

My problem is getting the city, state to only appear once in the list.

Right now it appears like

Orlando, FL
Orlando, FL
Orlando, FL
Miami, FL


I can not get the nested repeat region to work because the city, state is in one table not two. Is there a solution? I've got everything else working. Looking for a solution that will work in a jump menu or a table list view. The site is ASP VBscript will SQL database.

Here is a sample of the code for the drop down:

<form name="form1">
<select name="select">
<%
While (NOT rs_jump.EOF)
%>
<option value="<%=(rs_jump.Fields.Item("City".Value)%>" <%If (Not isNull((rs_jump.Fields.Item("City".Value))) Then If ((rs_jump.Fields.Item("City".Value) = CStr((rs_jump.Fields.Item("City".Value))) Then Response.Write("SELECTED" : Response.Write(""%>><%=(rs_jump.Fields.Item("City".Value) & " " & (rs_jump.Fields.Item("State".Value) %></option>
<%

rs_jump.MoveNext()
Wend
If (rs_jump.CursorType > 0) Then
rs_jump.MoveFirst
Else
rs_jump.Requery
End If
%>



</select>
<input type="submit" name="Submit" value="Go">
</form>


Thanks.

Replies

Replied 18 Jul 2006 15:05:05
18 Jul 2006 15:05:05 Wayne Hultum replied:
in the sql command try

select distinct query here....

Reply to this topic