Filtering a Do ..... While Loop

Results 1 to 3 of 3

Thread: Filtering a Do ..... While Loop

  1. #1
    Join Date
    Dec 1969

    Default Filtering a Do ..... While Loop

    Hello,<BR><BR>I was wondering if there was a way to filter or sort perhaps output of a Do ..... While Loop. I am showing information in a drop down box from a table (named people) in a database. In my State Fields of my various records I have the values:<BR><BR>Texas, Florida, California, Ohio, Florida, Maryland<BR><BR>Here is some example code:<BR><BR>&#060;select name="SelectState"&#062;<BR>&#060;% <BR>Do While Not People.EOF<BR>Response.Write("&#060;option value=""" & _<BR>People("State") & """&#062;" & _<BR>People("State") & "&#060;/option&#062;")<BR>People.movenext<BR>Loop<BR>%&#06 2;<BR>&#060;/select&#062;<BR><BR>How do I make it that Florida is shown once and not twice in the drop down box???????<BR><BR>Example code is greatly appreciated.

  2. #2
    RobT Guest

    Default RE: Filtering a Do ..... While Loop

    Simple. You Distinctly select it.<BR><BR>Select Distinct State from tblData Order By State<BR><BR>Will remove all duplicates<BR><BR><BR>Rob<BR>

  3. #3
    Join Date
    Dec 1969

    Default Rob - You da Man!

    Rob - You da Man!<BR><BR>Thanks buddy.<BR><BR>Your code helped me solve my problem.

Posting Permissions

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