Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3309092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:35:59+00:00 2026-05-17T21:35:59+00:00

The query that im using is SELECT firstName + ‘, ‘ + lastName FROM

  • 0

The query that im using is

    SELECT firstName + ', ' + lastName FROM employees
    ORDER BY lastName

Which returns a table of values like

Workman, Bob

Nevarez, Ray

and so on, which is what I wanted. I’m using this query to populate a combobox full of employees. My question is, now that these results are put together like that, is it possible to use them in any way as an index? I want to be able to select that person in the combo box, hit the submit button, and have it pull up their profile. But since the combo box is only storing things like “Workman, Bob” im not sure what I would use to find that person in the next query. Does that make sense? Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:35:59+00:00Added an answer on May 17, 2026 at 9:35 pm

    Preferrably, you would use the primary key (probably employee_id) from your table as the index.
    Your query would look like this (or similar):

     SELECT firstName + ', ' + lastName AS fullname, employee_id FROM employees
     ORDER BY lastName
    

    Then, you’d use employee_id as the value of the option and fullname as the text/display. You can then link directly to the user by referencing their ID.

    If you went by name only, it’s possible two people could have the same name which would no doubt cause you some headaches.

    Edit:
    Using windows forms, you can bind the combo-box to a DataTable (containing your results) by doing something like this:

    DataTable dt; //populate this however you want with the query above
    combobox1.DataSource = dt;
    combobox1.DisplayMember = "fullname";
    combobox1.ValueMember = "employee_id";
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query in Delphi using DBExpress TSQLQuery that looks like so ActiveSQL.sql.add('SELECT
I'm using a SQL query that is similar to the following form: SELECT col1,
I have a query that I am generating the XML from in Oracle using
I have a query that searches for clients using like with wildcard. For example:
I have a query that is currently using a correlated subquery to return the
Using standard mysql functions is there a way to write a query that will
I have a DataGridView that I want to query using Linq (C# WinForm). I
I've got a sql query (using MS-SQL 2005) that generates data with these columns:
I'm trying to write a linq-to-sql query using || that behaves the same way
Edit: using SQL Server 2005. I have a query that has to check whether

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.