SQL Requery based on "Name starts with A, B, C, D

Results 1 to 3 of 3

Thread: SQL Requery based on "Name starts with A, B, C, D

  1. #1
    ScottB2 Guest

    Default SQL Requery based on "Name starts with A, B, C, D

    I have created a search results page that works great to this point. Now the client wants to add a feature that displays an alphabetical/numerical legend at the top that will enable the user to click on a letter or number and see a subset of the current recordset collection where the first letter of the Name field (from the database) matches the alpha or number that was selected by the user.<BR><BR>The legend would look like:<BR><BR>A &#124 B &#124 C &#124 D &#124 ... &#124 1 &#124 2 &#124 3 &#124 etc<BR><BR>and each character would contain a hyperlink to trigger the new query.<BR><BR>Any ideas on how to approach this?

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Requery based on

    The query would be:<BR><BR>"SELECT * FROM table WHERE name LIKE &#039" & request.querystring("letter") & "%&#039"<BR><BR>The % character is a wild card for strings in SQL.<BR><BR>Hope that does it for ya.

  3. #3
    B Clark Guest

    Default RE: SQL Requery based on

    Maybe you could create and alphabet/numeric List or dropdown list and send the selected letter to the .asp by referencing whatever element is selected in that form. Maybe I&#039m talking out of my ***...I&#039m still kind of new to this.<BR>The .asp would do the database search:<BR>Select * from &#060;whatever table&#062; where &#060;whatever field&#062; LIKE &#039A%&#039<BR><BR>..even better, maybe you could keep the record set (if you already have the records and do a record set search...recordset.find "whatever like A%", 0, adSearchForward<BR><BR>Now I know when this stuff gets hard.....good luck :))

Posting Permissions

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