Y
yeli
Unregistered / Unconfirmed
GUEST, unregistred user!
我用以下语句可以在SQLSERVER正常运行,而在ACCESS下无法运行,提示出错,请大家帮忙是什么原因。
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('select a.出库日期 as 出库日期,a.出库单号 as 出库单号,a.目的地 as 目的地,sum(b.数量) as 总数量,sum(b.箱数) as 总箱数,sum(b.方数) as 总方数 '); //提示出错
query1.SQL.Add('From ccpckd1 a,ccpckd2 b where a.出库单号=b.出库单号 and a.出库日期 >=:str_rq1 and a.出库日期<:str_rq2 group by a.出库单号,a.出库日期,a.目的地 order by a.出库日期');
query1.Parameters.ParamByName('str_rq1').Value :=strtodate(str_rq1);
query1.Parameters.ParamByName('str_rq2').Value :=strtodate(str_rq2);
query1.Open;
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('select a.出库日期 as 出库日期,a.出库单号 as 出库单号,a.目的地 as 目的地,sum(b.数量) as 总数量,sum(b.箱数) as 总箱数,sum(b.方数) as 总方数 '); //提示出错
query1.SQL.Add('From ccpckd1 a,ccpckd2 b where a.出库单号=b.出库单号 and a.出库日期 >=:str_rq1 and a.出库日期<:str_rq2 group by a.出库单号,a.出库日期,a.目的地 order by a.出库日期');
query1.Parameters.ParamByName('str_rq1').Value :=strtodate(str_rq1);
query1.Parameters.ParamByName('str_rq2').Value :=strtodate(str_rq2);
query1.Open;