Hi there !!
Please help me to sort out the error's. I have to submit this assignmnet on monday at any cost.
I got an assignment where i have to generate 5 html reports .. like Total events per month ( last 6 month), Daily events Analysis ( last 30 days) and so on.. based on campaigns.
If the user select all campaigns / single/ double comapiagns then i have to show reports accordingly. I have no issue of carrying the campaign information page to respective pages. The issue is on the above mentions reports.
In Total Events per month( last 6 month) :
Query 1: How can I get the last 6 month data and header dynamically ?
Below is the brief snippet code ..What i am doing so far..
Dim conn,rs,rs1,strsql,strq
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
set rs1 = Server.CreateObject("ADODB.Recordset")
conn.open "DSN=abc;UID=sqlboy;PWD=sqlboy;DATABASE=sqlboy "
' collecting selected campaigns number
Dim strchecked,acheckarray,iloop, tot
strchecked = Request.Querystring("camplist")
aCheckarray = split(strchecked, ",") %>
<tr bgcolor="#cacaca"><td>Campaign</td>
' i want this part dynamically
<td>Aug 03</td><td>Sep 03</td><td>Oct 03</td><td>Nov 03</td><td>Dec 03</td><td>Jan 04</td>
<td><b>Total</b></td></tr>
'fetching records one by one in arrays
<% For iloop = LBound(aCheckarray) to Ubound(acheckarray)
strsql="select * from campaigns where campnum = '"& acheckarray(iloop)&"'"
set rs = conn.execute(strsql) %>
<tr bgcolor="#ffffff"><td><%=rs("campname")%></td>
<% For i = 0 to 5 %>
<% strsq="select count(*) as numeve from events where evenum = '"& Rs("evenum")&"' and '"& datename("mm", evestart) &"' >= '"& datename("mm" , datediff("m",i-5 ,date))&"'"
set rs1 = conn.execute(strsq)
evenum = rs1("numeve") %>
<td><%=evenum %></td>
<% totc= evenum + totc %>
<% tot = evenum + tot %>
<% Next %>
<td><%=totc %></td>
</tr>
<% totc = 0 %>
<% Next %>
<tr bgcolor="#ffffff"><td></td><td></td><td></td><td></td><td></td><td><%=tot %></td></tr>
</table>
I am getting this error ...
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'datename'
Please help me..
With Thanks !!