Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIf() in SQL-Select???
Message
De
23/08/2001 09:16:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
22/08/2001 21:33:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00547729
Message ID:
00547886
Vues:
10
>Thanks it worked great, which lead me to another question regarding the ASC DESC values. I need to also sort ascending if the value in my LotOrder field is "A" and descending if the value in my LotOrder field is "D". Is the fix for this as simple as the last one?
>
>Thanks again for your help.
>
>Aloha,
>
>James

Apart from having separate SELECT - SQL statements, you can also use macro substitution.
lcOrderBy = iif(OrderByField = "D", "DESCENDING", "ASCENDING")
select ...
  order by MyField &lcOrderBy
  ...
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform