Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Iif statement - either have a field in report or empty s
Message
De
05/09/2005 13:09:25
 
 
À
05/09/2005 12:58:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01046801
Message ID:
01046804
Vues:
17
>Hi Everyone:
>
>I'm having a problem with a specific bit of code here. I'm hoping someone might be able to help me.
>
>i want to evaluate a condition, and if the condition is true, the report will print a field. if it evaluates to false, it will skip to the next field and print the next field on that line.
>
>the report is generated by a select command into a cursor with the report being created by the cursor.
>
>specifically, the code looks something like this:
>
>select firstfield, iff (fieldname = 1, "___________" as report_label, ""), lastfield, into cursor cursor_name
>
>create report report_name from cursor_name form
>
>I want the field to simply be the underlining, and the label to be report_label. if fieldname <> 1, then i want it to skip that line and print the lastfield on that line.
>
>What i want:
>
>if fieldname = 1:
>firstfield
>report_name _______________________
>lastfield
>
>
>if fieldname <> 1:
>firstfield
>lastfield
>
>currently, i am getting "missing comma". i've fooled around with it and have been able to get it so that it doesn't give me that error by putting quotes around the entire exp2, but it still isn't what i'm looking for.
>
>any help is greatly appreciated. thanks.
>
>paul
select   firstfield, ;
         repl(iif(fieldname = 1, '_', ' '), 11) as report_label, ;
         lastfield, ;
         .... ;
     from ... ;
     into cursor cursor_name
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform