Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution
Message
De
13/02/2003 16:24:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
13/02/2003 16:08:15
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00752893
Message ID:
00752904
Vues:
13
>All,
>
> I want to use macro substitution in a select statement. I have a field in a table that references variable. With the code that is below I am getting a missing operand message and I not sure why. Please help!
>
>
>select * from promolist;
>where qq_promo and BITTEST(region,0);
>and DATE() <= promolist.expire;
>and IIF(!EMPTY(promolist.qqfield) and &promolist.qqfield ,.T.,.F.)
>
The problem is that the dot stops macro substitution. Try copying the field to a variable first, something like this:
MyField = promolist.qqfield
select * from promolist;
  where qq_promo and BITTEST(region,0);
  and DATE() <= promolist.expire;
  and !EMPTY(promolist.qqfield) and &MyField
Note that I simplified the unnecessary iif().

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