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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add a literal value to the end of a SELECT clause ? 1

Status
Not open for further replies.

GarHeard

Programmer
May 3, 2005
28
US
Is there a way I can place the following SELECT clause:

SELECT Branch FROM tblBranches ORDER BY Branch

in a Row Source of a List Box and in addition ADD an additional SELECT value of ALL to the tail end of the list.
For example, let's say tblBranches.Branch has values of 101, 102, 103, 104 and 105. I want to allow the user to be able to select the following values:

101,102,103,104,105,ALL
 
SELECT Branch & '' As realBranch FROM tblBranches
UNION SELECT 'All' FROM tblBranches
ORDER BY 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I apologize. I should have stated that branch is defined as nvarchar.

Thus, I get the error message:

Invalid operator for data type. Operator equals boolean
AND, type equals navarchar.
 
So, simply this:
SELECT Branch FROM tblBranches
UNION SELECT 'All' FROM tblBranches
ORDER BY 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top