title: How to display drop down options alphabetically without worrying about case sensitive in classic asp?
body: <p>I have a drop down box in my classic ASP page and using MS SQL for database. The drop down list includes the brand names starting with lower case, upper case and starting brand name with numbers. </p>
  
  <p>For instance, <code>itcosmetics</code>, <code>Colorpop Cosmetics</code> and <code>5 Hour energy</code> respectively. Currently, this dropdown is showing/displaying brands alphabetically but by case i.e. lower case, number, upper case.</p>
  
  <p>In other words, it is displaying all lower case brand name alphabetically first then the brand with numbers alphabetically and finally brand names starting with uppercase alphabetically.</p>
  
  <p>However, what I am trying is : I want to display my options according to the alphabetical orders without worrying about the case of the brand name.</p>
  
  <p>for example: if the brand names are <code>1 apple</code>, <code>applea</code>, <code>Appleb</code>, <code>3 fans</code>, <code>balla</code>, <code>Ballb</code>, <code>cat</code>, <code>Doll</code>.</p>
  
  <p>Currently, its displaying drop down option as following:</p>
  
  <pre>
  applea
  balla
  cat
  1 apple
  3 fans
  Appleb
  Ballb
  Doll
  </pre>
  
  <p>But I want something like following:</p>
  
  <pre>
  1 apple
  3 fans
  applea
  Appleb
  balla
  Ballb
  cat
  Doll
  </pre>
  
  <p>How can I do that?</p>
  
  <p>My code :</p>
  
  <pre><code>&lt;select&gt;
      &lt;OPTION value=0&gt;-- SELECT --&lt;/OPTION&gt;
          &lt;% 
              DIM RS, varQueryBrand, varBrand
  
              IF Request.QueryString("brandID") &lt;&gt; "" THEN
                  varQueryBrand = Request.QueryString("brandID")
              ELSE
                      varQueryBrand = "SELECT"
              End IF
  
              SQL = "SELECT DISTINCT(brand) as brand FROM tblproduct"
  
              SET RS=objConn.Execute(SQL)  
  
              IF NOT (RS.BOF and RS.EOF) THEN 
                  WHILE NOT RS.EOF
                      varBrand = RS("brand") 
                      IF LCase(varQueryBrand) = LCase(varBrand) THEN
                          Response.Write "&lt;option selected value=""" &amp; replace(RS("brand")," &amp; ","@") &amp; """&gt;" &amp; RS("brand") &amp; "&lt;/option&gt;"
                      ELSE            
                          Response.Write "&lt;option value=""" &amp; replace(RS("brand")," &amp; ","@") &amp; """&gt;" &amp; RS("brand") &amp; "&lt;/option&gt;"
                      End IF
                      RS.MoveNext
                  WEND 
              END IF
                   RS.close
                  SET RS = nothing
          %&gt;
      &lt;/select&gt;
  </code></pre>
  
  <p>I tried writing <code>ORDER BY brand</code> at the end of SQL statement, but there was no chage in the output. So can you please help me?</p>