Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Network:
Windows 2003 Server
>>Can you use a CASE statement in a VFP query (similar to SQL Server)? If not, what is the best way to populate a field if it is empty when running a query? I want it to have something like 'View Record' if the field is empty or the field value if there is something in the field. Hopefully this makes sense. Thanks.
>>
>>Doug
>
>Isn't there a function like EVL()? I don't have Visual FoxPro handy right now, but that should be simpler than an IIF(). I think it would be similar to NVL(). (When you do an outer join, the records from one table that have no match in the other table have null fields for the other table.)
>
Yes, EVL() is a way to avoid empty values. Do be warned that, unlike IIF(), it evaluates _all_ its parameters. I got burned in a case where I was calling a function as the second parameter, and couldn't understand why it was being called even when the first parameter wasn't empty.
Tamar
Précédent
Suivant
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