lQuery1 := 'SELECT '+ '[No_],[Sell-to Customer No_],[Bill-to Customer No_],[Bill-to Name],[Bill-to Name 2],[Bill-to Address],[Bill-to Address 2],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],; lQuery2 := '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ '[somefield],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],[fieldname],'+ 'FROM ['+aDatabaseName+'].[DBO].['+aCompanyName+'$Sales Invoice Header]'+ 'WHERE ([fieldname] <> '''') AND ([fieldname] = ''1753-01-01 00:00:00.000'')'; ADORecordsetSalesInvoiceHeader := SQLADOServer.Execute(lQuery1+lQuery2); <---------------------------------------------------