|
|
|
ช่วยด้วยครับ วนตรงนี้ยังไงครับเพื่อให้ได้ผลลัพธ์ดังนี้ครับ รหัสลูกค้า.......1......... ปี |
|
|
|
|
|
|
|
<!-- #include virtual="dbconnect.asp"-->
<%
'Set rs=Server.Createobject("ADODB.Connection")
Set rs =Server.CreateObject("ADODB.Recordset")
sql="SELECT YEAR(DocDate) AS Expr3, MONTH(DocDate) AS Expr2, ArCode, "&_
"SUM(TotalAmount) AS Expr1 FROM BCARINVOICE WHERE (IsCancel <> 1) "&_
"GROUP BY YEAR(DocDate), MONTH(DocDate), ArCode "&_
"ORDER BY YEAR(DocDate), MONTH(DocDate), ArCode;"
rs.Open sql,conn,1, 3 %>
<%
If Rs.EOF Then
%>
äÁèÁÕ¢éÍÁÙÅã¹µÒÃÒ§ !
<%Else%>
<body>
<table width="800" border="1">
<tr>
<td><table width="800" border="1">
<tr> <% DO While Not Rs.EOF%>
<td>ª×èÍ<%= Rs("arcode")%></td>
</tr>
<tr>
<td><table width="800" border="1">
<tr>
<td width="68">»Õ</td>
<td width="69">1</td>
<td width="70">2</td>
<td width="48">3</td>
<td width="48">4</td>
<td width="48">5</td>
<td width="48">6</td>
<td width="48">7</td>
<td width="48">8</td>
<td width="48">9</td>
<td width="48">10</td>
<td width="48">11</td>
<td width="59">12</td>
</tr>
<tr>
<td><%= Rs("expr3")%></td>
<td><%= Rs("expr1")%></td>
วนตรงนี้ยังไงครับเพื่อให้ได้ผลลัพธ์ดังนี้ครับ
รหัสลูกค้า.......1.........
ปี 1 2 3 4 5 6 7 8 9 10 11 12
2005 1000 1500 300
2006 2000 2100 1700
</tr>
</table></td>
</tr> <% Rs.MoveNext
Loop
Rs.Close
Conn.Close
End If%>
</table>
</td>
</tr>
</table>
Tag : - - - -
|
|
|
|
|
|
Date :
4 มิ.ย. 2549 21:51:49 |
By :
kao |
View :
1907 |
Reply :
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|