Multiline - drop down list question

Below is my scenario:
I have a multi-record non-db block showing up in a tab canvas (say T). This tab canvas is supposed to be like detailssection in the form. In this tab canvas, one of the tabs is named 'Recon'. In this tab, there is an drop down list item called 'Purpose', which I am populating with a dynamic query using a look up value table.
However, since it is a multi-record block, I have about 5 records displayed. My dynamic query populates only the 1st drop down list item ('Purpose'). I can put the query in a loop and populate the remaining drop down 'Purpose' list items.But, how would I know when to stop the loop? i.e., how many records should it loop? Also, let us say the user completes all the 5 records, but then navigates to the 6th record (scrolls down using the scroll bar) then how would I know to populate the drop down list item ('Purpose') in the 6th record?
Can any one suggest an easy way to accomplish this?
Thanks,
Chiru
Edited by: Megastar_Chiru on May 7, 2010 3:30 PM
Edited by: Megastar_Chiru on May 7, 2010 3:30 PM
Edited by: Megastar_Chiru on May 7, 2010 3:31 PM

Yes. that is a mul-record block. How to populate the list is my question. That is what I am trying to figure out.I asked some information.
how you are populating your list and on which trigger can you post the code?
And sure there is nothing code in WHEN-NEW-RECORD-INSTANCE which is refreshing the list? Because when you populate any list for it shows for all records either in multi-record or single record.
-Ammad

Similar Messages

  • Fill-In-The-Blank drop-down list in HTML5 output

    I'm working in Captivate 7 (WIN) and developing for both SWF and HTML5 output, viewing courses in IE9 for Windows and Safari on iPad.
    I have a quiz containing a fill-in-the-blank question, using a drop-down list to select the correct answer, however it does not display the drop-down button or function correctly in HTML5 output (see screenshot).
    The issue began after updating to Captivate 7 version 7.0.1.237. The drop-down list worked prior to the update I installed recently. I'm viewing the published course locally and in the LMS, and it does not work in either.
    I've not read in the help documents that drop-down list questions are an unsupported question type in HTML5, and so I'm wondering if this is a bug that needs to be reported. Has anyone encountered this issue?

    Do you need scoring? There is a Scrolling Text interaction (more control, you can empty the variable and it will be displayed empty) but it is a non-interactive one, no score possible except by adding other interactive objects.
    Custom Short Answer Question - Captivate blog

  • Populating fields, drop down lists, etc... from external data

    Hi,
    I am trying to evolve my forms, and am interested in learning how to connect my forms to external data sources.  I assume using server solutions would work, but are complex and costly.  They are also likely beyond my scope of understanding.  What are the best practices for doing this?  Can it be done with a text file or spreadsheet?  I am really looking for a better way to create custom data in forms than to go into the script and change them manually.  Price is a good example.  I have some forms that generate a very basic quote for services.  When the price of part x changes I need to going into the from chance the script for those items, re-save it and hope I have not missed any items.  Evey time his happens it is a hassle.  Not to mention if more than one user needs it I have to make sure they are all using the right version (to be clear I am less worried about this part as it seems a complex task).
    Is there a better way of doing this?  What are the best practices for this?  What external sources can be used to hold the data.  I would be interested in any tutorials that may exist on the subject as well.
    Thanks in advance for any/all help. 
    Tom
    P.S. it is amazing what LCD can do, and that I really enjoy working in it, although I have little background in scripting.  Great product and resource!

    Thanks Paul,
    I have been able to solve the drop down list question, thanks to your help.
    I have another question that involves locking specific fields in a four page form which contains approximately 100 fields that need to be locked before the end user completes the remaining fields. How do I lock individual subforms so that the remaining fields remain open and editable?  The final version of the form, will have at least 200 fields in it that will also need to be locked in sections.
    I can lock all the fields using the lock all fields button, but have been unable to make it work for just part of the form.
    I've emailed the draft form.  It would be really helpful if I had one example of a locked subform on the form I'm struggling with.
    Thanks for your help.
    Nellie

  • Drop down lists populating text fields on a page different from the dropdown.

    Hello all,
    I have a form with several pages. The first page contains a number of drop down lists. These drop down lists, when an option is chosen, is to populate a text field on another page. I can get the drop down list to populate the text field when it is on the same page, but as soon as I move the text field to another page, the script doesn't work. Can anyone offer a solution? I've used javascript on change for the scripts.

    Thanks Paul,
    I have been able to solve the drop down list question, thanks to your help.
    I have another question that involves locking specific fields in a four page form which contains approximately 100 fields that need to be locked before the end user completes the remaining fields. How do I lock individual subforms so that the remaining fields remain open and editable?  The final version of the form, will have at least 200 fields in it that will also need to be locked in sections.
    I can lock all the fields using the lock all fields button, but have been unable to make it work for just part of the form.
    I've emailed the draft form.  It would be really helpful if I had one example of a locked subform on the form I'm struggling with.
    Thanks for your help.
    Nellie

  • Sequence question drop-down list gets hung up on punctuation

    I'm making a sequence question. In drag-and-drop mode, it
    works fine. But in the drop-down list mode, it breaks. In other
    words, even if it is displaying correctly, it is "wrong" when the
    enduser tries to sequence the choices.
    I assume that this is because one of my items has punctuation
    in it.
    It's a person's name, so it looks like this:
    Lastname, FirstInitial.
    Or it could be even two people:
    Lastname, FirstInitial. & Lastname, FirstInitial.
    Is there a way to escape the commas and periods? (I'm willing
    to give up on ampersand!) Use ASCII, escape ActionScript or
    JavaScript? I'm not likely to solve the problem by experimenting,
    so I'm wondering if someone else has figured this out. THANKS.
    (I tried searching the forum, but searching does not seem to
    be working for me)

    I can't help you with this myself as I've not done it but there are quite a few tutorials kicking around the net.
    Simple ODBC Connections in Adobe LiveCycle:
    http://www.youtube.com/watch?v=C56_Cz-aE0c
    Connecting a form to a database:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    Database connected forms:
    http://acrobatusers.com/tutorials/database-connected-forms

  • C5.5 Issue with color/colour in matching question drop down list

    Hi is there a way to change the colour of the letters that appear in the drop down lists for a matching question in 5.5?
    I'm using white text on a grey background for my quiz slides, which is nice and easy to read, but then in the preview the letters in the drop down appear as white text on a white background. I can't see a way to change the font in the drop down back to black (as it is on my editing view), without also changing the colour of the answer text.
    Is there a way to change this?
    I've just tried covering the lists over with a chunk of background image - so that the user doesn't even know they're there, but the quiz slide has ordered the image behind the lists.
    Failing there being a way to change the colour, is there a way to have a matching slide without a drop down list at all?
    Thanks for reading
    Lynn

    Hi Shekhar
    Thanks for the extra info - I'd tried changing the properties and using the object style manager before, but hadn't considered using them together.
    This time, I followed your advice and:
    I set the colour for 'Matching entries' to black in the object style manager
    Then went into each column 1 entry and set the text to white
    The result was white text in the column, with black in the list. Much better than before!
    However, when I changed the text in column 2 to white, the list entries became white as well.
    After a lot of experimentation, I've discovered that if you just select the text object and change the colour, you change all the text including the lettering and numbering of the answer - this changes the list colour.
    If you change the text in the answer by highlighting it, this doesn't affect the lettering/numbering, however it still changes the drop down
    To leave the drop down the right colour you need to change the answer colour by highlighting first, but, and the order is vital, you need to insert a space between the letter/number and the answer text first.
    So, the end result I have is that the column 1 text is the right colour, the column 2 text is the right colour and the text in the drop down is the right colour. Unfortunately the lettering for the column 2 answers has to stay the same  as the letters in the drop down list, so they don't show up brilliantly (black on a dark grey background), but it's a massive improvement on the invisible list I had before!
    Thanks again!
    Lynn

  • Drop-down list database question

    Hey there. So this is what I want to do. I want a drop-down list that would have hundreds of possible choices. The user could pick one and several text fields throughout the document would populate accordingly. I'm assuming there would have to be a database of some sort where all the data would live, and a way to tell live cycle that all of certain fields are connected and need to change depending on that first drop down. I hope that makes sense.
    While that would work, the even better idea would be some kind of a menu within the form for picking the initial item. I understand that would probably be more complicated, but a way for the user to navigate through several categories to find the proper item would be absolutely great.
    I don't expect anyone to do this for me... I'm just having trouble finding a responsibly simple walk-though so that I can figure it out myself. So if anyone has a sample form that does this, or has an idea of the best kind of database to use, that would be great.
    Thanks in advance!!

    OK to narrow this question down a little more, since I posted this, I was able to create a simple access db and create a drop-down list that would have the specified column drop down and I could pick it. Now I just need to figure out how to make a separate text box display the information from the corresponding column of what was picked from the drop down. I think once I can get that done, building the rest of the database and sorting out the fields needed should not be too hard. If anyone could point me in the right direction I would really appreciate it.

  • How to get Date value from database and display them in a drop down list?

    Hello.
    In my Customers table, I have a column with Date data type. I want to create a form in JSP, where visitors can filter Customers list by year and month.
    All I know is this piece of SQL that is convert the date to the dd-mm-yyyy format:
    SELECT TO_CHAR(reg_date,'dd-mm-yyyy') from CustomersAny ideas of how this filtering possible? In my effort not to sound like a newbie wanting to be spoonfed, you can provide me link to external notes and resources, I'll really appreciate it.
    Thanks,
    Rightbrainer.

    Hi
    What part is your biggest problem?? I am not experienced in getting data out of a database, but the way to get a variable amount of data to show in a drop down menu, i have just messed around with for some time and heres how i solved it... In my app, what i needed was, a initial empty drop down list, and then using input from a text-field, users could add elements to a Vector that was passed to a JComboBox. Heres how.
    package jcombobox;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class Main extends JApplet implements ActionListener {
        private Vector<SomeClass> list = new Vector<SomeClass>();
        private JComboBox dropDownList = new JComboBox(list);
        private JButton addButton = new JButton("add");
        private JButton remove = new JButton("remove");
        private JTextField input = new JTextField(10);
        private JPanel buttons = new JPanel();
        public Main() {
            addButton.addActionListener(this);
            remove.addActionListener(this);
            input.addActionListener(this);
            buttons.setLayout(new FlowLayout());
            buttons.add(addButton);
            buttons.add(remove);
            add(dropDownList, "North");
            add(input, "Center");
            add(buttons, "South");
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == addButton) {
                list.addElement(new SomeClass(input.getText()));
                input.setText("");
            } else if (e.getSource() == remove) {
                int selected = dropDownList.getSelectedIndex();
                dropDownList.removeItemAt(selected);
        public void init(String[] args) {
            setSize(400,300);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(new Main());
    }And that "SomeClass" is show here
    package jcombobox;
    public class SomeClass {
        private String text;
        public SomeClass(String input) {
            text = input;
        public String toString() {
            return text;
    }One of the things i struggled a lot with was to get the dropdown menu to show some usefull result. If the list just contains class references it will show the memory code that points to that class. Thats where the toString cones in handy. But it took me some time to figure that one out, a laugh here is welcome as it should have been obvious :-)
    When the app is as simple as this one, using a <String> vector would have been easier, but this is just to demonstrate how to place classes in a vector and get some usefull info out of it, hope this answered some of your question :-)
    The layout might have been easier to write, than using the toppanel created by the JApplet and then the two additional JPanels, but it was just a small app brewed together in 15 minutes. Please comments on my faults, so that i can learn of it.
    If you need any of the code specified more, please let me know. Ill be glad to,

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Problem with drop down list: on Windows it works, on Mac doesn't

    Dear forum,
    I am reworking the MultiPageImporter2.5 script by Scott Zanelli; going to add some new features.
    So far I added a drop down list so the user could choose on which pages to place a pdf/indd file: odd/even/both.
    However I encountered a strange problem: on Windows it works as expected, but on Mac nothing happens when I click the popup. When I write a dialog, I almost always use automatic layout and never encountered such a problem before. But in this script the author uses fixed position for the controls so I followed his coding style:
    dLog.pageSideMode = dLog.pan4.add('dropdownlist', [10,110,180,40], ["Odd and Even Pages", "Only Odd Pages", "Only Even Pages"]);
    dLog.pageSideMode.selection = pageSideMode;
    The drop down list is visible both on Windows and Mac, but on Mac it’s not clickable. What am I doing wrong?
    Another question: in the script, the author created three popups. In the code, each popup has a different height (the last element of the “bounds” array) – 60, 88, 33. Does it make sense to make them different if on the screen they look exactly the same (I mean height).
    Here’s my version of the script.
    I think the easiest solution for me here is to rework the dialog part from fixed to automatic layout.
    Thanks in advance.
    Kasyan

    Hi johniko,
    In my version of the script, the user will have to choose a file to be placed directly in the dialog box. The selected file can be saved into a preset. I'm reworking it for another person (not for myself) and that's what he wants.
    Regards,
    Kasyan
    P.S. By the way, you can simply merge all your pdf-files into a single document in Acrobat.

  • How can I get a drop-down list selection also be selected in another field with the same list but a different name?

    I have a street address and a billing address. A question is posed with a checkbox — "Is the billing address the same as the street address?" If Yes is checked, the street address automatically fills the billing fields. If No is checked, the user must fill in new information. In both the street address and billing addres, the State field is a drop-down list. How can I get the drop-down list selection in the street address State also be selected in drop-down list for the billing address State?

    Has anyone done this?

  • How can I make a bound drop-down list using OAF?

    Please note, this is for OAF. I am aware of the support in ADF.
    I'm sorry this is such a basic question, but I've been trying for days, and I can't think of anywhere else to look for an answer.
    I need a simple drop-down list, not a search. This particular list only has 10 or so items. It is based on a view containing a code value, and a description. I need all descriptions to be available at all times. Just click the arrow, and the entire list is displayed. When the user selects an entry, the code associated with the discription populates a bound attribute. Ideally, when the page is instantiated, the code value controls the text value visible in the collapsed drop-down list. Visually, it would be similar to an html <select> element.
    Can someone please tell me how I can produce such a simple thing, or point me to some documentation?
    Thank you.

    Thank you for the excellent reference Peddi. I had played with the OAMessageChoiceBean component yesterday, but I was able to tell from your instructions that "Picklist Display Attribute" and "Picklist Value Attribute" really are not for binding to the database EO. That was the key piece of information that had me confused.
    In addition to adding the messageChoice component to the page, I needed to write some code to synchronize the picklist value with the corresponding code value, which I placed in am OAFormValueBean (hidden form field) which I could then bind to my application's database EO in the controller, running in the processFormRequest procedure:
    /** Synchronize the catalog code with the selected catalog name */
    protected void syncCatalogValues(OAPageContext pageContext,
    OAWebBean webBean, MyApplicationAMImpl am) {   
    OAMessageChoiceBean mcb =
    (OAMessageChoiceBean) webBean.findChildRecursive("CatalogName");
    OAFormValueBean cc =
    (OAFormValueBean) webBean.findChildRecursive("CatalogCode");
    String catalogDescription = mcb.getText(pageContext);
    if (catalogDescription != null) {
    String catalogCode = am.getCatalogCode(catalogDescription);
    cc.setValue(pageContext, catalogCode);
    Along with a little code to get the catalogCode value from the LOVVO, that's all it took.
    Thanks again. This was a great help.
    Pete

  • The portlet name is not displayed in the portlet drop down list ?

    Hi,
    I use Sun Java System Portal Server 6 2005Q4 for windows 2000 server , use the following command to deployo portlet,
    I am not sure if I successfully deploy the portlet?
    pdeploy deploy -u amAdmin -w amadmin -p amadmin -d "cn=amldapuser,ou=DSAME Users,dc=icheng,dc=com" C:\Sun\PortalServer\tmp\portlet\portletsamples.war
    The message I got after execute the pdeploy command is =>
    Deploys the portlet war file and inserts the provider into display profile..
    OPTIONS
    --help Help message (false)
    -u --runasdn UID Bind DN (none)
    -w --password Password (none)
    -p --wc_password Password for WebContainer's Admin (none)
    -i --instance WebContainer's Instance into which the war file is to be deploye
    d (*)
    -d --dn LDAP DN of the target node (*)
    -g --global Global display profile (false)
    -r --rolesfile File containing the DSAME and portlet role mapping (*)
    -f --userinfofile File containing the user info mapping (*)
    -v --verbose Generate debug messages (false)
    -V --version Generate version information (false)
    -l --locale Locale information (en_US)
    OPERAND
    Specifies a path to the war location.
    Deploying to IWS
    Is this mean that successfully deploy the portlet ?
    After I deploy the portlet, I login to Access Manager, select the "service" from view, click the portal desktop,
    click "Manage Channels and Containers", click the "New Portlet Channel...", then click the portlet drop down list,
    the portlet name is not displayed in the portlet list.
    How can I make the portlet name displayed in the portlet drop down list ?
    Can someone help me ?
    Thanks!

    Hi
    According to your description, since this is SQL Server forum, as Olaf Helper’s post, could you get the correct result if you execute the following query in SQL Server Manager Studio (SSMS)?
    select UserName from aspnet_Users where UserId in(select FreindId from myFreinds where UserId in(select UserId from aspnet_Users where UserName = '<your typed name>'))
    If you cannot get the correct result in SSMS, I recommend to check the Transact-SQL statement. Apart from the error message, we also need to know the table structure, data, join relationships between tables for further analysis.
    However if there is no problem in SQL Server query, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, there is detail about listbox control in asp.net. You can review the following links:
    How to Bind/Load/Fill ListBox with Sql Server Database in asp.net:http://www.webcodeexpert.com/2013/07/how-to-bindloadfill-listbox-with-sql.html#.U5f75_6KCM9
    How to get multiple selected value in ListBox control - ASP.NET using C#:
    http://www.dotnetfox.com/articles/how-to-get-multiple-selected-value-in-listbox-control-Asp-Net-using-C-Sharp-1047.aspx
    Thanks
    Lydia Zhang

  • How to show first parameter value in drop down list as a default value dynamically in ssrs report?

    Hi,
    in my ssrs report i have two parameters, accounts and Manager ,there is a cascading between the accounts parameter and manager parameter, as per the cascading we will get managers names based on the account we selected in the accounts parameter,
    my requirement is the first name in the mangers drop down list  has to get selected as default value.
    please help me with this, it is an urgent requirement.
    Thanks in advance,
    Naveen

    Hi NaveenMSBI,
    According to your description, you want to use cascading parameters in the report, if the accounts are selected when you preview the report, the first manager name will be selected from drop down list as the default value. If so, there can be two scenarios:
    • If manager is single-valued parameter, we can get Available Values and Default Values from the same query as below. Then when the accounts are selected, the first manager name will be selected as default value.
    SELECT managerName FROM table_name WHERE accounts IN (@accounts)
    • If manager is multi-valued parameter, we need to use different query for Available Values and Default Values. In this case, please refer to Patrick’s solution.
    For more information about Adding Cascading Parameters, please refer to the following document:
    http://technet.microsoft.com/en-us/library/aa337498(v=sql.105).aspx
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • Drop down list based on log in username - php mysql

    I have a drop down list of client names on a php page that filters a second drop down list of site names.
    At the moment, any user who logs in can see the entire list of clients, however I want to filter the list based on their username log in.
    This is the entire page code, the section in bold is the drop down list in question:
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "asguser,admin,member";
    $MM_donotCheckaccess = "false";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && false) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "accessdenied.html";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <html>
    <body>
    <script type="text/javascript">
    function AjaxFunction(client_UID)
    var httpxml;
    try
      // Firefox, Opera 8.0+, Safari
      httpxml=new XMLHttpRequest();
    catch (e)
      // Internet Explorer
              try
                        httpxml=new ActiveXObject("Msxml2.XMLHTTP");
                  catch (e)
                    try
                  httpxml=new ActiveXObject("Microsoft.XMLHTTP");
                    catch (e)
                  alert("Your browser does not support AJAX!");
                  return false;
    function stateck()
        if(httpxml.readyState==4)
    var myarray=eval(httpxml.responseText);
    // Before adding new we must remove previously loaded elements
    for(j=document.testform.subcat.options.length-1;j>=0;j--)
    document.testform.subcat.remove(j);
    for (i=0;i<myarray.length;i++)
    var optn = document.createElement("OPTION");
    optn.text = myarray[i];
    optn.value = myarray[i];
    document.testform.subcat.options.add(optn);
        var url="dd.php";
    url=url+"?client_UID="+client_UID;
    url=url+"&sid="+Math.random();
    httpxml.onreadystatechange=stateck;
    httpxml.open("GET",url,true);
    httpxml.send(null);
    </script>
    <form name="testform" method='POST' action='mainck.php'>
    Select first one
      <select name=cat onChange="AjaxFunction(this.value);">
      <option value=''>Select One</option>
    <?
    require "config.php";// connection to database
    $q=mysql_query("SELECT DISTINCT * FROM qry_test GROUP BY client_name ASC");
    while($n=mysql_fetch_array($q)){
    echo "<option value=$n[client_UID]>$n[client_name]</option>";
    ?>
    </select>
    <select name=subcat>
    </select><input type=submit value=submit>
    </form>
    </body>
    </html>
    I think I need to amend the sql statement to something like this - but I haven't quite got it right:
    SELECT DISTINCT * FROM qry_test WHERE username = colname GROUP BY client_name ASC
    Where do I drop the code for the colname info?
    name:colname
    type: text
    default value: -1
    run time value: $_SESSION['MM_Username']
    Thanks!

    I don't do PHP but it would be something like:
    $sql = sprintf (SELECT DISTINCT * FROM qry_test WHERE username = %s GROUP BY client_name ASC, $_SESSION['MM_Username'] );
    or you can just embed the session variable into the sql string.
    But why are you using the GROUP BY clause? If you just need a distinct list of names, use the DISTINCT keyword and reduce your select list to only the needed column.

Maybe you are looking for