Solved

Help With SQL Select

Posted on 2007-12-05
4
213 Views
Last Modified: 2010-04-21
Experts,

I'm writing a SQL select statement for a report and have a few requirements that I must meet.

I need to select from my orders table the First and Last name of the user

Table: Orders
Column: FirstName
Column: LastName

BUT I need to select them as one column in the result set, "Name". So my select would give me something like,

::Name::
FirstName + " " + LastName

Is this possible? If so, how would I form the SQL?

Thanks so much for your help!

~ C
0
Comment
Question by:clickclickbang
4 Comments
 
LVL 10

Accepted Solution

by:
answer_me earned 200 total points
ID: 20411203
Select Isnull(FirstName,'') + '  ' + isnull(LastName,'') as '::Name::' from Orders
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 200 total points
ID: 20411220
select FirstName + ' ' + LastName as Full_Name from orders
0
 
LVL 19

Assisted Solution

by:Limbeck
Limbeck earned 100 total points
ID: 20411281
unless you use firebird, than it would be

select FirstName || ' ' || LastName as Full_Name from orders
0
 
LVL 1

Author Closing Comment

by:clickclickbang
ID: 31412835
Thanks for the quick response, didn't know it was that easy!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now