X
xyt3dnow
Unregistered / Unconfirmed
GUEST, unregistred user!
本人的一段程序,将pardox数据库的三个日期字段分离为年、月、日。但转到sql数据库后
却不能运行通过,求高手修改。
form1.adoquery1.Close;
form1.adoquery1.SQL.Clear;
form1.adoquery1.SQL.Add('SELECT Qsrq,Jzrq,Djrq, id,fwzl,czr,czry,mj,fwjg,bz,yf,fzjg,fzdq,fwsyzh,xxdd,');
form1.adoquery1.SQL.Add('EXTRACT(YEAR FROM Qsrq) AS qy,EXTRACT(MONTH FROM Qsrq) AS qM,');
form1.adoquery1.SQL.Add('EXTRACT(DAY FROM Qsrq) AS qD,EXTRACT(YEAR FROM Jzrq) AS jy,');
form1.adoquery1.SQL.Add('EXTRACT(MONTH FROM Jzrq) AS jM,EXTRACT(DAY FROM Jzrq) AS jD,');
form1.adoquery1.SQL.Add('EXTRACT(YEAR FROM Djrq) AS dy,EXTRACT(MONTH FROM Djrq) AS dM,EXTRACT(DAY FROM Djrq) AS dD');
form1.adoquery1.sql.add('from kknd');
form1.adoQuery1.Prepared;
form1.adoquery1.Open;
提示为,incorrect syntax near the key word 'from'
却不能运行通过,求高手修改。
form1.adoquery1.Close;
form1.adoquery1.SQL.Clear;
form1.adoquery1.SQL.Add('SELECT Qsrq,Jzrq,Djrq, id,fwzl,czr,czry,mj,fwjg,bz,yf,fzjg,fzdq,fwsyzh,xxdd,');
form1.adoquery1.SQL.Add('EXTRACT(YEAR FROM Qsrq) AS qy,EXTRACT(MONTH FROM Qsrq) AS qM,');
form1.adoquery1.SQL.Add('EXTRACT(DAY FROM Qsrq) AS qD,EXTRACT(YEAR FROM Jzrq) AS jy,');
form1.adoquery1.SQL.Add('EXTRACT(MONTH FROM Jzrq) AS jM,EXTRACT(DAY FROM Jzrq) AS jD,');
form1.adoquery1.SQL.Add('EXTRACT(YEAR FROM Djrq) AS dy,EXTRACT(MONTH FROM Djrq) AS dM,EXTRACT(DAY FROM Djrq) AS dD');
form1.adoquery1.sql.add('from kknd');
form1.adoQuery1.Prepared;
form1.adoquery1.Open;
提示为,incorrect syntax near the key word 'from'