Re: concatenating fields in an SQL query
From: Willy Verbiest (willy.verbiest_at_Advantra_No_Spam.com)
Date: 02/18/05
- Next message: Dennis: "Re: ADO OLEDB connection to MSSQL: pooling not working"
- Previous message: John: "Re: change error message"
- In reply to: Sunil Furtado: "Re: concatenating fields in an SQL query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 09:06:05 +0100
Sunil,
It works, I've changed the lines to:
iif(isnull(tblContacts.FirstName),'',tblContacts.FirstName + ' ') +
iif(isnull(tblContacts.MiddleName),'',tblContacts.MiddleName + ' ') +
iif(isnull(tblContacts.LastName),'',tblContacts.LastName) as ContactName
Thanks,
Willy
"Sunil Furtado" <sunil@furtado.de> wrote in message
news:42159015@newsgroups.borland.com...
> SELECT
> tblContacts.*,
> iif(isnull(tblContacts.FirstName,' ',tblContacts.FirstName) )+ ' ' + etc
>
> Sunil
>
> ----- Original Message -----
>
>> I'm trying to concatenate 3 fields: FirstName + MiddleName + LastName to
>> get a nieuw field ContactName to select in dropdownbox.
>> If one of the 3 fields is empty i get an empty ContactName string back.
>> Here is the SQL
>>
>> SELECT
>> tblContacts.*,
>> tblContacts.FirstName + ' ' +
>> tblContacts.MiddleName + ' ' +
>> tblContacts.LastName as ContactName
>> FROM tblContacts
>> WHERE tblContacts.CustomerID = :CustomerID
>> ORDER BY LastName, FirstName
>
>
- Next message: Dennis: "Re: ADO OLEDB connection to MSSQL: pooling not working"
- Previous message: John: "Re: change error message"
- In reply to: Sunil Furtado: "Re: concatenating fields in an SQL query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|