Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL statement
Message
 
À
24/08/2005 13:36:16
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
01043492
Message ID:
01043510
Vues:
9
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
Fil
Voir

Click here to load this message in the networking platform