query1的sql语句有
1)select isnull(a.indate,b.outdate)date,IBid,InItem,INinfo,OBid,outitem,outinfo from inbill a full join outbill b on a.indate=b.outdate
2)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate where year(indate)between';
str:=str+inttostr(year1)+' and '+inttostr(year2)+' and month(indate) between '+inttostr(month1)+' and '+inttostr(month2);
str:=str+'or year(outdate) between'+inttostr(year1)+' and '+inttostr(year2)+' and month(outdate) between '+inttostr(month1)+' and '+inttostr(month2);
str:=str+'and a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
3)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate where indate';
str:=str+'>='''+edt_date1.Text+''' and indate<='''+edt_date2.Text+'''';
str:=str+'or outdate>='''+edt_date1.Text+''' and outdate<='''+edt_date2.Text+'''';
str:=str+'and a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
4)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate';
str:=str+'where a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
query2的sql语句有
1) select * from inbill
2) str:='SELECT DISTINCT isnull(year(a.indate),year(b.outdate))col FROM inbill a full join outbill b on a.indate=b.outdate';
str:=str+'where a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
报错说sql语法错误:'a'附近有语法错误但我查了很久都没找到,变成sql语句在查询分析器里也可以运行,这是怎么回事,高手帮帮忙
1)select isnull(a.indate,b.outdate)date,IBid,InItem,INinfo,OBid,outitem,outinfo from inbill a full join outbill b on a.indate=b.outdate
2)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate where year(indate)between';
str:=str+inttostr(year1)+' and '+inttostr(year2)+' and month(indate) between '+inttostr(month1)+' and '+inttostr(month2);
str:=str+'or year(outdate) between'+inttostr(year1)+' and '+inttostr(year2)+' and month(outdate) between '+inttostr(month1)+' and '+inttostr(month2);
str:=str+'and a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
3)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate where indate';
str:=str+'>='''+edt_date1.Text+''' and indate<='''+edt_date2.Text+'''';
str:=str+'or outdate>='''+edt_date1.Text+''' and outdate<='''+edt_date2.Text+'''';
str:=str+'and a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
4)str:='select isnull(a.indate,b.outdate)date,Initem,INmoney,Outitem,outmoney from inbill a full join outbill b on a.indate=b.outdate';
str:=str+'where a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
query2的sql语句有
1) select * from inbill
2) str:='SELECT DISTINCT isnull(year(a.indate),year(b.outdate))col FROM inbill a full join outbill b on a.indate=b.outdate';
str:=str+'where a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';
报错说sql语法错误:'a'附近有语法错误但我查了很久都没找到,变成sql语句在查询分析器里也可以运行,这是怎么回事,高手帮帮忙
解决方案 »
- 急需Delphi方面的资料
- delphi中复制文件并判断硬盘空间
- 请朋友解决拦路虎--DBNavigator的使用,当连接上datesourse时,按扭怎么变成灰色
- 俺真晕了,advStringGrid是不是用编码也无法实现ctrl多选?非连续的多选。捣鼓了一晚上也没有整出来。
- 如何按下回车键就退出该循环?
- 窗体应用:无法改变应用程序图标,Project Options->Application->Locd Icon...变灰了
- 又是一個傷心的夜晚!苦悶,散分………!
- ie6图片工具拦的原理
- 列位同仁有没有使用Delphi程序将SQL SERVER 中的数据倒入Access中,怎么做?
- 还是关于importedconstraint的疑问,诸位大虾请进!
- 起名 汪姓 女孩 非诚勿进
- 关于Delphi 2010默认Widechar
str:=str+'where a.username='''+frm_load.edt_username.Text+''' or b.username='''+frm_load.edt_username.Text+'''';// str:= str+'where // 这里没有空格 即 str+' where...你可以把全部SQL语句在执行前,插入到MEMO里来排错 memo1.line.append(adoquery1.sql.text)
执行前将SQL语句显示出来,可以即时检查在哪儿有错。