<%
sqlstring = "select distinct year(Actiondate) as yyyy, month(Actiondate) as mm from Assessment where score <> null order by 1 desc,2 desc"
SET RS1 = CONN.EXECUTE(sqlstring)
do until rs1.eof
sql = "select Aname " _ & ", sum(iif(year(Actiondate) = '" & rs1("yyyy") & "' and month(Actiondate) = '" & rs1("mm") & "' and score=1,1,0)) as score1 " _
& "FROM Assessment group by Aname "
SET RS = CONN.EXECUTE(sql)
%>
<% rs1.movenext
loop
%>
ตรงสีแดงครับ ผมจะ group เพื่อหาจำนวนของ score=1 ครับ แต่มัน Error ครับ
-----------------------------------------------------------------------------------------------------------
Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
-----------------------------------------------------------------------------------------------------------
ครับ
Tag : ASP, Ms Access, MySQL, Oracle
Date :
2012-02-23 10:19:09
By :
sununrak
View :
1394
Reply :
2
No. 1
Guest
<%
sqlstring = "select Aname,year(Actiondate) as y, month(Actiondate) as m,sum(score) as score1 from Assessment where score is not null and score = 1 group by Aname,year(Actiondate),month(Actiondate) order by Aname,year(Actiondate),month(Actiondate)"
SET RS1 = CONN.EXECUTE(sqlstring)