Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL and report
Message
De
15/06/2000 13:53:06
 
 
À
15/06/2000 09:23:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00380692
Message ID:
00380867
Vues:
16
Construct a Sql statment that returns the field you need based on a test condition using the IIF() function, like that: IIF(lcondition, field1, field2). Remember that you can nest IIF() functions.

Ex. Select iif(lcondition, filed1, iif(lcondition2, field2, field3)) as "field_name", other fields.... from... etc..

Run this Sql Select command on VFP's command window using the clause INTO DBF (dbf_name).

So, you have a standalone .dbf file, that can be used to construct the report. On report DE, put a reference to that .dbf file but remember to set the properties autoclosetables and autoopentables to .F.

This way you can execute the Select Sql statment on you code using the clause INTO CURSOR (same_name_of_dbf), and after runs the report, that will references the CURSOR not the table used to construct the report.

I hope this helps.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform