Results 1 to 8 of 8

Thread: [RESOLVED] SQL DISTINCT only works for the first item in my listbox

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Resolved [RESOLVED] SQL DISTINCT only works for the first item in my listbox

    This is a 2 part question:

    1. I use the following sql statement fill my second listbox (this works fine):

    strSQL = "SELECT DISTINCT * FROM Vehicle"

    The problem is that only the first item in the first listbox will be affected by the DISTINCT in the sql, but the remaining items in the first listbox will not.

    Ex.. If the user selects "BrassTag" from the listbox, then the second listbox will populate with the numbers for "BrassTag" with no duplicates.

    When the user selects the next item (ClassCode) from the same listbox, then the second listbox will populate with the data for "ClassCode",but with duplicates.

    2. How to get the blank fields out of my listbox? Certain fields in my database have nothing in them and when the sql retrieves the data for my listbox I get blank spaces.

    I tried using trim, but it didnt work
    Last edited by cfd33; Apr 30th, 2007 at 10:13 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width