Results 1 to 3 of 3

Thread: Combo Boxes

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    Combo Boxes

    I am populating a combo box with a column froma database,
    the problem I have is this column has duplicate values. So I get 2 or three of the same values. Is there anyway to eliminate duplicates and only have one of each value in the combobox?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    When you are running the sql statement, use the DISTINCT keyword:

    This way will get you all the rows in the column including duplicates:
    SELECT myColumn FROM MyTable

    This way will only return the rows that are not duplicates:
    SELECT DISTINCT myColumn FROM MyTable

  3. #3

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    Thanks!!

    Thats exactly what I need!

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