Versions des environnements
Jerry;
SELECT ltrim(rtrim(field1)) + ‘ ‘ + ltrim(rtrim(field2)) + ‘ ‘ + ltrim(rtrim(field3)) AS mynewfield FROM mytable
If you have null values you can use:
SELECT isnull(ltrim(rtrim(field1)),'') + ‘ ‘ + isnull(ltrim(rtrim(field2)),'') + ‘ ‘ + isnull(ltrim(rtrim(field3)),'') AS mynewfield FROM mytable
Tom
>In my VFP applications, I join fields together in many of my SQL statements using a VFP table. As such:
>
> SELECT mytable.field1, ALLTRIM(mytable.field2) + "-" + ALLTRIM(mytable.field3) AS mycolumn FROM mytable INTO CURSOR c_mycursor
>
>Is there any way to do something like this using Asp.Net and SQL Server?
>
>Thanks,
>
>Jerry
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement