Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using IIF in Select
Message
De
15/04/2005 00:19:54
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, États-Unis
 
 
À
14/04/2005 23:30:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01004977
Message ID:
01004985
Vues:
14
Thanks - works great!

>>SELECT invno, IIF(usesr2,salesrep2,'') FROM invpost
>>
>>The above select returns only the first character of the salesrep2 field. I think that is because the usesr2 is a Logical field. How can I return the full length of the salesrep2 field?
>>
>>Randy Wessels
>
>Within a SELECT statement, you should only use fixed-length expression, for example, iif(usesr2, salesrep2, space(10)) (assuming 10 is the length of the field), or padr(iif(usesr2, salesrep2, ''), 10)
>
>Otherwise, in your example, the first record that VFP encounters might very well be a record that does NOT fulfill the iif()-condition, so VFP decides that 1 character is enough to accomodate the result.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform