Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1368

Re: Gow to write this select statement

From "Bob Barrows" <reb01501@NOSPAMyahoo.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Gow to write this select statement
Date 2012-12-09 08:39 -0500
Organization A noiseless patient Spider
Message-ID <ka24ai$p3m$1@dont-email.me> (permalink)
References <ka22k2$g3k$1@dont-email.me>

Show all headers | View raw


Tony Johansson wrote:
> Hello!
>
> Is it possible  to write a select statement that return both FName
> and LName as just FullName with a space in between
> something like Select (FName  +  "  " + LName) as FullName from
> employees
> So I can use FullName when I bind to a dropdownlist
> ddlEmployee.DataSource = backEnd.GetEmployees ();
>        C.DataTextField = "FullName ";
>        ddlEmployee.DataValueField = "EId";
>        ddlEmployee.DataBind();
>
Just change the double-quotes to single quotes and you've got it.
SELECT FName + ' ' + LName As FullName from employees 

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

Gow to write this select statement "Tony Johansson" <johansson.andersson@telia.com> - 2012-12-09 14:10 +0100
  Re: Gow to write this select statement "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-12-09 08:39 -0500

csiph-web