Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report with lots of user options
Message
 
To
28/10/2007 20:21:22
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01264661
Message ID:
01264695
Views:
7
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
Previous
Reply
Map
View

Click here to load this message in the networking platform