只
只你
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
procedure TFrmSaleSch.ToolButton1Click(Sender: TObject);
var
__sql,__sqlw,__c:string;
begin
__sql:='select * from SHSheetid where 1=1 ';
if Edit5.Text <>'' then begin
__sqlw:=' and sheetid='+''''+edit5.Text+'''';
end;
if edit2.Text<>'' then begin
__sqlw:=__sqlw+' and productid='''+edit2.Text+'''';
end;
if edit4.Text<>'' then begin
__sqlw:=__sqlw+' and Pname like '+'''%'+edit4.Text+'%''';
end;
if CheckBox1.Checked then begin
__sqlw:=__sqlw+' and Pdate >= #'+formatdatetime('yyyy-mm-dd',DateTimePicker1.datetime)+'#'
+' and Pdate <= #'+formatdatetime('yyyy-mm-dd',DateTimePicker2.datetime)+'#';
end;//就是执行到这边的时候哦跳出pdate参数没有默认值
if __sqlw='' then begin
showmessage('请输入查找条件!');
exit;
end;
procedure TFrmSaleSch.ToolButton1Click(Sender: TObject);
var
__sql,__sqlw,__c:string;
begin
__sql:='select * from SHSheetid where 1=1 ';
if Edit5.Text <>'' then begin
__sqlw:=' and sheetid='+''''+edit5.Text+'''';
end;
if edit2.Text<>'' then begin
__sqlw:=__sqlw+' and productid='''+edit2.Text+'''';
end;
if edit4.Text<>'' then begin
__sqlw:=__sqlw+' and Pname like '+'''%'+edit4.Text+'%''';
end;
if CheckBox1.Checked then begin
__sqlw:=__sqlw+' and Pdate >= #'+formatdatetime('yyyy-mm-dd',DateTimePicker1.datetime)+'#'
+' and Pdate <= #'+formatdatetime('yyyy-mm-dd',DateTimePicker2.datetime)+'#';
end;//就是执行到这边的时候哦跳出pdate参数没有默认值
if __sqlw='' then begin
showmessage('请输入查找条件!');
exit;
end;