Select by letter after db table output?

Results 1 to 3 of 3

Thread: Select by letter after db table output?

  1. #1
    Join Date
    Dec 1969
    Posts
    73

    Default Select by letter after db table output?

    Im having trouble working out how to select records by first letter. <BR>The table contents is displayed on screen after retreiving from the Access db. I want to now use a drop down menu to allow the user to select the letter they want to view. <BR>eg: &#039A&#039 for userids starting with A. <BR>Any ideas on how i should tackle this?

  2. #2
    Join Date
    Dec 1969
    Posts
    463

    Default RE: Select by letter after db table output?

    Notice the Like statement in the following SQL string I cut from some code I have. It is Matching the first character in the string strName with a Name in the CUSTOMER_NAME field. The % will match any procedding characters after the first. So if the value of strName was A it would match all records which start with A. If strName = Allen it would also match any records beginning with A. If you changed 1 to say 4 it would still match all records starting with A if strName = A but would only return records Matching Alle followed by anything else, if strName = Allen.<BR><BR>strSQL = "SELECT * FROM tblDealerList WHERE CUSTOMER_NAME like &#039" & Left(strName,1) & "%&#039 ORDER BY CUSTOMER_NAME"<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    73

    Default RE: Select by letter after db table output?

    Thanks for the tip! <BR>Ive just started a job writing ASP so ive got much to learn! <BR>thank goodness for this board and for its users. <BR><BR>

Posting Permissions

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