adoquery1.SQL.Add('select 员工编号,sum(迟到) as 共迟到总数 from jiguo where 日期 between '''+datetostr(datetimepicker1.date)+''' and '''+datetostr(datetimepicker2.Date)+''' group by 员工编号');
其中表的日期字段类型为日期时间型默认值date()
出错信息:标准表达式中数据类型不匹配 大哥怎么解决 急!!
其中表的日期字段类型为日期时间型默认值date()
出错信息:标准表达式中数据类型不匹配 大哥怎么解决 急!!
解决方案 »
- 如何取ppt中文本的链接地址
- 一个SQL语句错误:InsUserQuery:Missing SQL property
- 为何我在sql 里面使用 extract 来判断月份会出错阿
- 一些Sql语句???????
- 如何改变PageControl的外观?
- 简单问题
- 在线等待,答对马上给分。关于qreport的问题
- quickreport欲缆时,当其内容未全部打开时(如打开50%)点按CLOSE,一次或多次后整个PROGRAM 崩溃!!!
- StringGrid怎么使得固定列中的标题居中显示?
- 组件stringgrid显示ORCAL数据库中的数据,具体如何操作
- 请问有谁用过cnpack?
- 请问一个在命令行下调用DCC32编译程序的奇怪问题(内详)
这样写‘---’是因为在这里我加不上缩进 用的时候把‘-’去掉
这样写‘---’是因为在这里我加不上缩进 用的时候把‘-’去掉
procedure Tfrmsearch.dtpbeginChange(Sender: TObject);
begin
edtbegin.Text := FormatDateTime('YYYY-MM-DD', dtpBegin.Date);
end;procedure Tfrmsearch.dtpendChange(Sender: TObject);
begin
edtend.Text := FormatDateTime('YYYY-MM-DD', dtpend.Date);
end;实际生成SQL语句的时候这样写(我这样写,没出过错!):
if (edtBegin.Text <> '') and (edtEnd.Text <> '') then
begin
BoxSQL := BoxSQL + Format('and Op_Date>=''%S'' and Op_Date<=''%S''',[edtBegin.Text, edtEnd.Text]);
Result := True;
end
else
if edtBegin.Text <> '' then
begin
BoxSQL := BoxSQL + Format('and Op_Date=''%S'' ', [edtBegin.Text]);
Result := True;
end
else
if edtEnd.Text <> '' then
begin
BoxSQL := BoxSQL + Format('and Op_Date=''%S'' ', [edtEnd.Text]);
Result := True;
end;