StrSQL:= 'select JGNo,GSF from tBJGGS where (CKJi1<='+s1+' and CKJi2>='+s1+')' ;
你这句写错了
第一个'+s1+' 与 and之间加个空格
s什么数据库?MYSQL?
StrSQL:= 'select JGNo,GSF from tBJGGS where (CKJi1<='+s1+'and CKJi2>='+s1+')' ;
WHERE条件的and与s1之间得加个空格吧
改成:
StrSQL:= 'select JGNo,GSF from tBJGGS where (CKJi1<='+s1+' and CKJi2>='+s1+')' ;
StrSQL里面用两个单引号表示一个引号
StrSQL:= 'select JGNo,GSF from tBJGGS where (CKJi1<=’‘+s1+’‘ and CKJi2>=’‘+s1+’‘)'
试试