Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hard to explain - Building SQL
Message
 
À
14/01/2009 17:10:24
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01373759
Message ID:
01373769
Vues:
21
This message has been marked as the solution to the initial question of the thread.
If I undestood you correctly, I think a simple FOR loop after the SCAN should do it
	m.ix = 0
	SCAN
		m.ix = m.ix + 1
		lcFields = lcFields + IIF(m.ix > 1, ', ','') + ALLTRIM(FieldName) + ' AS Fld'+TRANSFORM(ix)
	ENDSCAN
	for m.ix = m.ix to 8
		lcFields = lcFields + IIF(m.ix > 1, ', ','') + ' [ ]AS Fld'+TRANSFORM(ix)
	next i
	lnReportColumnCount = m.ix
	RunSQL = 'SELECT ' + lcFields + ' FROM ' + lcTable + ' ORDER BY ' + lcOrderField + ' INTO CURSOR ReportCursor'
	&RunSQL
* Update, of course you needed to remove the field name from the expression in the FOR
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform