select (convert(char (10),recorddate,120)) as recorddate,person
into #aa
from tablename
select recorddate,sum(person) as person
from #aa
group by recorddate
into #aa
from tablename
select recorddate,sum(person) as person
from #aa
group by recorddate
select (convert(char (10),recorddate,120)) as recorddate,
sum(person) as person from tablename
group by recorddate
select RecordDate=convert(char(10),RecordDate,120),Person=sum(Person)
from 表
group by convert(char(10),RecordDate,120)
不过还是感谢火兄的帮助!
from Con_Record
group by convert(char(10),RecordTime,120)----------------------------------------------------------------------
Server: Msg 409, Level 16, State 2, Line 1
sum or average aggregate 运算不能以 varchar 数据类型作为参数。
from 表
group by convert(char(10),RecordDate,120)
select RecordDate=convert(char(10),RecordTime,120),人数=count(CardNo)
from Con_Record
group by convert(char(10),RecordTime,120)2004-06-15 19
2004-06-16 10
yesterday2000(火焱)兄的select RecordDate=convert(char(10),RecordTime,120),Person=Count(CardNo)
from Con_Recordgroup by convert(char(10),RecordTime,120)2004-06-15 19
2004-06-16 10
问题解决了,多谢了!!!!
from Con_Record
group by convert(char(10),RecordTime,120)