10 个解决方案
#1
sql语句有问题。加上一个断点,看输出什么sql,尤其是括号、引号的匹配。
#2
是不是少了一个 ON
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied ) b On a.billcode=b.billcode where(biidate between '"+dptStart .Value +"'and '"+dtpEnd +"')
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied ) b On a.billcode=b.billcode where(biidate between '"+dptStart .Value +"'and '"+dtpEnd +"')
#3
第二行...
)b on a.billcode=b.billcode
ps:新手要在查询分析器里写sql,测试好再说...
)b on a.billcode=b.billcode
ps:新手要在查询分析器里写sql,测试好再说...
#4
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
消息 102,级别 15,状态 1,第 1 行
',' 附近有语法错误。
#5
新手永远把高手当编译器使。
#6
这SQL写的
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
红色标注的格式错误
而且 你的什么as 以及表的别名之间好歹加一个空格啊。
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
红色标注的格式错误
而且 你的什么as 以及表的别名之间好歹加一个空格啊。
#7
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"')
GROUP BY b.tradecode, b.fullname,b.qty,b.price
试试
试试
#8
同意!
少了一个ON!
#9
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied )b
on a.billcode=b.billcode……
#10
#1
sql语句有问题。加上一个断点,看输出什么sql,尤其是括号、引号的匹配。
#2
是不是少了一个 ON
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied ) b On a.billcode=b.billcode where(biidate between '"+dptStart .Value +"'and '"+dtpEnd +"')
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied ) b On a.billcode=b.billcode where(biidate between '"+dptStart .Value +"'and '"+dtpEnd +"')
#3
第二行...
)b on a.billcode=b.billcode
ps:新手要在查询分析器里写sql,测试好再说...
)b on a.billcode=b.billcode
ps:新手要在查询分析器里写sql,测试好再说...
#4
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
消息 102,级别 15,状态 1,第 1 行
',' 附近有语法错误。
#5
新手永远把高手当编译器使。
#6
这SQL写的
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
红色标注的格式错误
而且 你的什么as 以及表的别名之间好歹加一个空格啊。
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"') GROUP BY b.tradecode, b.fullname
红色标注的格式错误
而且 你的什么as 以及表的别名之间好歹加一个空格啊。
#7
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum( b.tsum ) from tb_sell_main a inner join (select billcode,tradecode,price, fullname,sum(qty ))as qty,sum(tsum)as tsum from tb_sell_detailed GROUP BY tradecode, billcode, fullname,price)b on a.billcode=b.billcode where(billdate between '"+dptStart .Value +"'and '"+dtpEnd.value +"')
GROUP BY b.tradecode, b.fullname,b.qty,b.price
试试
试试
#8
同意!
少了一个ON!
#9
select b.tradecode,b.fullname,b.fullname,b.qty,b.price,sum(b.tsum) from tb_sell_main a inner join (select billcode,tradecode,fullname,sum(qty),sum(tsum)from tb_sell_detalied )b
on a.billcode=b.billcode……