Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628

    Unanswered: Create a shortlist of multiple items

    In my database table i have multiple occurrences of the same elements i.e. Hardware, Protocols, Software etc.

    Rather than type these values into a combo box, i'd like it to automatically look up the relevant table and then present the user with a list of the items. I.e. If there's 30 instances of Hardware and 75 instances of Software, i only want the combo box to display 1 of each.

    Im sure its a simple thing to do, but i just can't seem to see what the answer is.

    Thanks for your help.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    SELECT DISTINCT yourFieldName FROM yourTableName ORDER BY yourFieldName;

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    How are you enforcing the value 'Software' and 'Hardware' ? I assume through Foreign Keys, and if that is the case you can select the values from the parent table.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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