"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='"+DTPicker1.Value+""+text1.Text+ " ":00:00"'and tm='"+DTPicker1.Value+""+text2.text+" ":00:00"'"错在 那里?
"select STCD,sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='"+DTPicker1.Value+" "+text1.Text+ ":00:00"'and tm='"+DTPicker1.Value+" "+text2.text+":00:00"'"
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='" +DTPicker1.Value+" "+text1.Text+":00:00' and tm='"+DTPicker1.Value+" "+text2.text+":00:00'"
在使用聚合函数时,查询的数据如果只有聚合函数就不需要groupby,有其他列时一定要加在group by 后面 "select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='" +DTPicker1.Value+" "+text1.Text+":00:00' and tm='"+DTPicker1.Value+" "+text2.text+":00:00'" group by STCD
列和列之间是需要加逗号隔开的"select STCD,sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='" +DTPicker1.Value+" "+text1.Text+":00:00' and tm='"+DTPicker1.Value+" "+text2.text+":00:00'" group by STCD
在vb6.0中 提示缺少结束语,错误指在group,那里还 有 错?
where between 中间连个字段名都没有?
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='" +DTPicker1.Value+" "+text1.Text+":00:00' and tm='"+DTPicker1.Value+" "+text2.text+":00:00'"
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where tm between '"+DTPicker1.Value+" "+text1.Text+ ":00:00"' and '"+DTPicker1.Value+" "+text2.text+":00:00'"
在vb6.0中 提示缺少结束语,错误指在group,那里还 有 错?
select STCD, sum(isnull(DRP,0)) as DRP from ST_PPTN_R where tm between '"+DTPicker1.Value+""+text1.Text+ " ":00:00"'and '"+DTPicker1.Value+""+text2.text+" ":00:00"'
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where tm between '"+DTPicker1.Value+" "+text1.Text+ ":00:00'and '"+DTPicker1.Value+" "+text2.text+":00:00'" 改为这个试试,你写的Between语法不对,应该是 [Column] Between [value1] And [value2] 的格式,然后你可以在程序中输出一下你的SQL语法,然后到查询分析器检查一下
"select STCD,sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='"+DTPicker1.Value+" "+text1.Text+ ":00:00"'and tm='"+DTPicker1.Value+" "+text2.text+":00:00"'"
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='"
+DTPicker1.Value+" "+text1.Text+":00:00' and
tm='"+DTPicker1.Value+" "+text2.text+":00:00'"
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where between tm='"
+DTPicker1.Value+" "+text1.Text+":00:00' and
tm='"+DTPicker1.Value+" "+text2.text+":00:00'" group by STCD
+DTPicker1.Value+" "+text1.Text+":00:00' and
tm='"+DTPicker1.Value+" "+text2.text+":00:00'" group by STCD
STCD sum(isnull(DRP,0)) as DRP
from
ST_PPTN_R
where
between tm='"
+DTPicker1.Value+" "+text1.Text+":00:00'
and
tm='"+DTPicker1.Value+" "+text2.text+":00:00'"
"select STCD sum(isnull(DRP,0)) as DRP
from ST_PPTN_R
where tm between '"+DTPicker1.Value+" "+text1.Text+ ":00:00"' and '"+DTPicker1.Value+" "+text2.text+":00:00'"
between '"+DTPicker1.Value+""+text1.Text+ " ":00:00"'and
'"+DTPicker1.Value+""+text2.text+" ":00:00"'
"select STCD sum(isnull(DRP,0)) as DRP from ST_PPTN_R where tm between '"+DTPicker1.Value+" "+text1.Text+ ":00:00'and '"+DTPicker1.Value+" "+text2.text+":00:00'"
改为这个试试,你写的Between语法不对,应该是 [Column] Between [value1] And [value2] 的格式,然后你可以在程序中输出一下你的SQL语法,然后到查询分析器检查一下