Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hard to explain - Building SQL
Message
De
14/01/2009 17:10:24
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Hard to explain - Building SQL
Divers
Thread ID:
01373759
Message ID:
01373759
Vues:
73
I'm using this in a report, works great except that there are fields on the report that may not be in the SQL results. I need to be able to include this in the SQL if the number of records (m.ix or lnReportColumnCount) is only 4:
" ' ' AS Fld5, ' ' AS Fld6, ' ' AS Fld7, ' ' AS Fld8"
But this if the number of records is 6:
" ' ' AS Fld7, ' ' AS Fld8"
This is a section of the block of code:
	m.ix = 0
	SCAN
		m.ix = m.ix + 1
		lcFields = lcFields + IIF(m.ix > 1, ', ','') + ALLTRIM(FieldName) + ' AS Fld'+TRANSFORM(ix)
	ENDSCAN
	lnReportColumnCount = m.ix
	RunSQL = 'SELECT ' + lcFields + ' FROM ' + lcTable + ' ORDER BY ' + lcOrderField + ' INTO CURSOR ReportCursor'
	&RunSQL
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform