Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECTing Correct FieldNames
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SELECTing Correct FieldNames
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00995349
Message ID:
00995349
Views:
52
I have the following two SQL statements:
 DO CASE
   CASE lcFilter = "Contains"  && A case-INsensitive "contains" search.
	 SELECT &lcSearchField,* FROM &srTable WHERE custid = srCustid AND ;
         UPPER(srOtherData) $ UPPER(&lcSearchField) INTO CURSOR csrOther
	 srView = "csrOther"

   CASE ThisForm.cboFilter.Value = "Exact"  && A case-INsensitive "exact" search.
	 SELECT &lcSearchField,* FROM &srTable WHERE custid = srCustid AND ;
	 UPPER(srOtherData) == UPPER(&lcSearchField) INTO CURSOR csrOther
	 srView = "csrOther"
 ENDCASE
My SELECT statements start out as " SELECT &lcSearchField,* ", because I want the resulting cursor to display the "&lcSearchField" in the first position ONLY, and not a second time with a suffix of "_b"(example: Manufactur_a and a second time as Manufactur_b). These two SELECT statements are used to search various tables, depending on what the user sets the Search Form to.

Do I need to manually build an SQL statement using an Array built with AFIELDS() and concatenation? Or is there a better way?

Thank you.
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Next
Reply
Map
View

Click here to load this message in the networking platform