I am trying to select a record set that has a variable used where field names are normally listed., Why wont this work and what might be the best work around?
lcSort = ''
IF Thisform.lstsorted.listcount >= 1
FOR lnCount = 1 TO (Thisform.lstsorted.listcount)
lcItem = Thisform.lstsorted.listitem(lnCount)
IF (lnCount) = 1
lcSort = 'ALLTRIM('+lcItem+')'
ELSE
lcSort = lcSort + ' + ' + 'ALLTRIM('+lcItem+')'
ENDIF
ENDFOR
ENDIF
select * from (infile) where city = 'Palm Bay' or city = 'Malabar' or city = 'Valk' ;
ORDER BY (lcsort)
Thanks in advance
lcSort = ''
IF Thisform.lstsorted.listcount >= 1
FOR lnCount = 1 TO (Thisform.lstsorted.listcount)
lcItem = Thisform.lstsorted.listitem(lnCount)
IF (lnCount) = 1
lcSort = 'ALLTRIM('+lcItem+')'
ELSE
lcSort = lcSort + ' + ' + 'ALLTRIM('+lcItem+')'
ENDIF
ENDFOR
ENDIF
select * from (infile) where city = 'Palm Bay' or city = 'Malabar' or city = 'Valk' ;
ORDER BY (lcsort)
Thanks in advance