Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I...
Message
De
07/11/2000 12:19:06
 
 
À
06/11/2000 16:59:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00438565
Message ID:
00438856
Vues:
9
>>In VFP, if I have a logical field, I can do something like this:
>>
>>select iID, iif(lLogical, 'Open', 'Closed') from sometable
>>
>>This will return the word Open or Closed depending on the value of lLogical.
>>
>>Since SQL Server does not have an IIF function, how do I do the same thing using Transact SQL?
>
>Assuming a bit field (or numeric) where 1 = True and 0 = False:
>
select iID, mylogical =
>   case
>   when llogical = 0 then 'Closed'
>   else 'Open'
>   end
>from sometable
This works fine in Query Manager but does not work in a remote view. What I am going to do is create a SQL view that contains the PK and the result of the case. Then link that view into my VFP remote view to pull in the text.

Does anybody else have a better solution?
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform