急急急!数据库连接出现错误,错误提示:From子句语法错误。
急急急!答对可以追加分哦!我已经采用单引号形式,即:carQuary.StartTime<='"+bd+"'ANDcarQuary.StopTime>='"+bd+"'"...
急急急!答对可以追加分哦!
我已经采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
但是有个新的问题是:至少一个参数没有被指定值
我已经采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
但是又有新的问题出现:至少一个参数没有被指定值
按照你的方法我已经试过了,改为这样:sql = "select loadcar.CarName,carQuary.sinSumLiquid,carQuary.SumLiquid,carQuary.sinLiquid,carQuary.loadSum from carQuary join loadcar on (loadcar.CarNum = carQuary.CarNum) where carQuary.StartTime <= # " + bd + " # AND carQuary.StopTime >= # " + bd + " # "
Set myrs = conndb(sql)
还是不行,提示From子句语法错误。
我已经将改为LEFT JOIN 了,出现了新的问题:日期的语法错误 在查询表达式carQuary.StartTime <= # " + bd + " # AND carQuary.StopTime >= # " + bd + " # "中,请高手帮帮忙,急! 展开
我已经采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
但是有个新的问题是:至少一个参数没有被指定值
我已经采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
但是又有新的问题出现:至少一个参数没有被指定值
按照你的方法我已经试过了,改为这样:sql = "select loadcar.CarName,carQuary.sinSumLiquid,carQuary.SumLiquid,carQuary.sinLiquid,carQuary.loadSum from carQuary join loadcar on (loadcar.CarNum = carQuary.CarNum) where carQuary.StartTime <= # " + bd + " # AND carQuary.StopTime >= # " + bd + " # "
Set myrs = conndb(sql)
还是不行,提示From子句语法错误。
我已经将改为LEFT JOIN 了,出现了新的问题:日期的语法错误 在查询表达式carQuary.StartTime <= # " + bd + " # AND carQuary.StopTime >= # " + bd + " # "中,请高手帮帮忙,急! 展开
3个回答
展开全部
你将join关键字加上连接限定关键字试下,比如:
left join
right join
inner join
==========================
你的#与双引号之间有空格,必须是:
carQuary.StartTime <= #" + bd + "# AND carQuary.StopTime >= #" + bd + "#"
如果仍然有问题,建议采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
left join
right join
inner join
==========================
你的#与双引号之间有空格,必须是:
carQuary.StartTime <= #" + bd + "# AND carQuary.StopTime >= #" + bd + "#"
如果仍然有问题,建议采用单引号形式,即:
carQuary.StartTime <='" + bd + "' AND carQuary.StopTime >='" + bd + "'"
展开全部
如果是SQL SERVER数据库,就不要使用#,而要使用单引号'。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select和from中间的字段是属于carQuary还是loadcar表的?
SELECT carQuary.CarName, carQuary.sinSumLiquid, carQuary.SumLiquid, carQuary.sinLiquid, loadcar.loadSum FROM ...
SELECT carQuary.CarName, carQuary.sinSumLiquid, carQuary.SumLiquid, carQuary.sinLiquid, loadcar.loadSum FROM ...
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询