procedure carCombo(Fmastro: String);
const
ctiCassa: array[0..1, 0..1] of string = (('101000000', '101001799'), // 1° range conti di Cassa (tabella piancont)
('101001990', '101001999')); // ultimo range conti di Cassa (tabella piancont)
ctiPart: array[0..2, 0..1] of string = (('102000000', '103999999'), // 1° range conti di contropartita pertinenti a "partmovv" (tabella piancont)
('105000000', '203999999'), // 2° range conti di contropartita pertinenti a "partmovv" (tabella piancont)
('205000000', '999999999')); // ultimo range conti di contropartita pertinenti a "partmovv" (tabella piancont)
ctiPrest: array[0..1, 0..1] of string = (('104000000', '104999999'), // 1° range conti di contropartita pertinenti a "prestmom" (tabella piancont)
('204000000', '204999999')); // ultimo range conti di contropartita pertinenti a "prestmom" (tabella piancont)
var
sql, sql2: String;
sql1: String= 'select NumVoce, NomeVoce, ContrPartSiNo, DtPrimoUso, DtUltimUso ' +
'from piancont where ';
begin
case Fmastro of
'Cas':
sql2 = ('(NumVoce >=' + ctiCassa[0,0] + 'and NumVoce <= ' + ctiCassa[0, 1] +
') or (NumVoce >= ' + ctiCassa[1, 0] + 'and NumVoce <= ' + ctiCassa[1, 1] + ')';
'Part':
sql2 = '(NumVoce >=' + ctiPart[0,0] + 'and NumVoce <= ' + ctiPart[0, 1] +
') or (NumVoce >= ' + ctiPart[1, 0] + 'and NumVoce <= ' + ctiPart[1, 1] +
') or (NumVoce >= ' + ctiPart[2, 0] + 'and NumVoce <= ' + ctiPart[2, 1] + ')';
else // 'Prest':
sql2 = '(NumVoce >=' + ctiPrest[0,0] + 'and NumVoce <= ' + ctiPrest[0, 1] +
') or (NumVoce >= ' + ctiPrest[1, 0] + 'and NumVoce <= ' + ctiPrest[1, 1] + ')';
end;
sql:= sql1 + sql2 + ' order by NumVoce';
Da quanto letto prima e dopo avere scritto quelle righe di codice, non riesco a trovare errori. Non capisco quale sia veramente.