Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT and Concatenating... 1

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
I have [ID No] and [ID Name]. In a drop-down on a form, I want to display [ID No] & "- " & [ID Name].

The following works when I want to display the ID No alone in the drop-down but I cannot combine ID No and ID Name:

SELECT DISTINCT [UNIT LIST].[ID NO] FROM [UNIT LIST];

Is this possible?

Thanks.

Richard...
 
Hi!

You can try the following:

Select ([ID No] & "- " & [ID Name]) as NewField From [Unit List]

My code assumes that the Distinct command in your query above isn't needed because ID No sounds like it would already be unique. Hopefully ID No and ID Name together will be unique at least. You can substitute a name that makes sense in you query for the NewField above.

hth
Jeff Bridgham
 
Thanks, Jeff. Worked like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top