Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a complex query
Message
From
29/11/2005 00:27:24
 
 
To
26/01/2005 08:33:34
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00980679
Message ID:
01072675
Views:
34
Hi

Here's some code that I use when exporting records to a spreadsheet or comma separated file etc. You can add as many AND lines as you may need.


Hope it helps
* Set select fields to blank so that all records are selected

lcselfield1 = ""
lcselfield2 = ""

* If check boxes are ticked on screen, change select fields accordingly

IF THISFORM.ChkBox8.VALUE = 1
	IF EMPTY(THISFORM.txtcustid.VALUE)
		lcselfield1 = "         "
	ELSE
		lcselfield1 = EVALUATE('Thisform.Txtcustid.Value')
	ENDIF
ENDIF

IF THISFORM.ChkBox9.VALUE = 1
	lcselfield2 = EVALUATE('Thisform.cbocyear.value') + EVALUATE('Thisform.cbocmonth.value')
ENDIF

SELECT Contacts.* ;
	FROM  Contacts ;
	WHERE Contacts.Custid = lcselfield1 ;
	AND Contacts.titlemonth = lcselfield2 ;
	ORDER BY Contacts.lastname, Contacts.firstname ;
	INTO TABLE(lcfullname1)
Previous
Reply
Map
View

Click here to load this message in the networking platform