SQLEXEC(hdl_conn,"select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx where lastupdatedate>='2008-10-01'and lastupdatedate<='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode","xs_temp1")
提示:语句中有不识别的命令
select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx where lastupdatedate>='2008-10-01'and lastupdatedate<='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode
可是这个SQL语句在查询分析器能够执行。怎么办呢?
"select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx where lastupdatedate>='2008-10-01'and lastupdatedate <='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode"
这个字符串超长度了,不能大于254。这是VFP的字符串限制,改为多个字符串连接相加即可,如改为:
"select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,"+"(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx"+" where lastupdatedate>='2008-10-01'and lastupdatedate <='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode"
SQLEXEC(hdl_conn,"select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx where lastupdatedate>='2008-10-01'and lastupdatedate <='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode","xs_temp1")
提示:语句中有不识别的命令
select goods.price,goods.type_zidingyi,xs1.goodscode,xs1.quantity,xs1.discount,xs1.providerdiscount from BAS_TB_Goods as goods,(select xsmx.goodscode,xsmx.quantity,xsmx.discount,xsmx.providerdiscount from sal_tb_retaildetail as xsmx where lastupdatedate>='2008-10-01'and lastupdatedate <='2008-10-02') as xs1 where goods.goodscode=xs1.goodscode
可是这个SQL语句在查询分析器能够执行。怎么办呢?
没人帮我解决呀