Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a complex query
Message
 
 
À
26/01/2005 08:33:34
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
00980679
Message ID:
01072675
Vues:
36
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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform