Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report with lots of user options
Message
 
À
28/10/2007 20:21:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01264661
Message ID:
01264695
Vues:
8
I tend to do something like this which lets me build the WHERE clause and anything else I want. I can add extra fields if I want. I can even conditionally add a JOIN and some fields.
lcWhere = ''
IF SomeCondition
  lcWhere = 'WHERE abc = [123]'
ENDIF
lcExtraField = ''
IF SomeCondition
  lcExtraField = 'zzz, '
ENDIF

TEXT TO m.lcSQL TEXTMERGE NOSHOW
  SELECT abc, ;
         def, ;
         <<lcExtraField>> ;
         xyz ;
  FROM SomeTable ;
  <<lcWhere>>
  INTO CURSOR Something
ENDTEXT
lcSQL = ALLTRIM(CHRTRANC( m.lcSQL, CHR(13) + CHR(10) + CHR(9) + ";", " " ))
&lcSQL
>Hi. Doing a SQL where end-user has a choice of any number of options. Should I do a macro substitution. Is there a tutorial on this? Is there an easier way?
>
>Thanks, Randy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform