Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP IIF() function replacement
Message
De
07/11/2003 14:29:05
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00847773
Message ID:
00847775
Vues:
15
>In VFP I could do:
>
>SELECT IIF(EMPTY(field1),field2,field1) AS field...
>
>to pull data conditionally in from either field between two fields in a table. Is there a way to do this in MSSQL? TIA.

You would use CASE function.
SELECT CASE WHEN LEN(field1)=0 THEN field2 ELSE field1 END AS field...
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform