Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement