|
rikki -> RE: Not sure - return xxx if the count is xx (12/10/2004 13:24:58)
|
It's still not working... Not sure if it's me or the code... I understand about the commas, and they are showing in the results page... <%
Dim conntemp, myDSN, myRS, mySQL, tempArray
Set conntemp=Server.CreateObject("ADODB.Connection")
myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../fpdb/index.mdb")
conntemp.open myDSN
%>
<%
mySQL = "SELECT * FROM ATTAWANDARON3 WHERE DateStart >=Date() ORDER BY DateStart ASC"
Set myRS = Server.CreateObject("ADODB.Recordset")
myRS.Open mySQL, conntemp, 3 , 3
tempArray = myRS.GetRows()
If not myRS.EOF THEN
recordCount = myRS.recordcount
end if
%>
<html>
<meta name="Microsoft Theme" content="blends 111">
<body>
<font face="arial">
<p>BOOKINGS - Camp Attawandaron - Sorted by Start Date</font>
</p>
<table border = "2" >
<tr> <td><B> <font size="1">Booking#</font></b></td>
<td><b> <font size="1">Date</font></b></td>
<td><b><font size="1">GROUP</font></b></td>
<td><b><font size="1">LAST NAME</font></b></td>
<td><b><font size="1">SITE(S)</font></b></td>
<%
FOR i = 0 to uBound(tempArray,2)
IF i MOD 4 = 0 then
Response.write("<br>")
END IF
if i=0 then
' write the first record
Response.Write "<tr>"
Response.Write "<td>" & tempArray(1,i) & ""
Response.Write "<td>" & tempArray(3,i) & ""
Response.Write " to " & tempArray(4,i) & ""
Response.write "<td>"
IF lcase(trim(tempArray(11,i)))&"" <> "not applicable!" THEN
Response.Write(tempArray(11,i))
END IF
Response.Write "<td>" & tempArray(19,i) & ""
Response.write "<td>"
tempArray2 = split(tempArray(27,i),",")
IF ubound(tempArray2) > 14 THEN
Response.write("All Sites Booked" )
ELSE
Response.write tempArray(27,i) & ", "
END IF
Response.write " "
else
If tempArray(11,i)=tempArray(11,i-1) then
If tempArray(19,i)=tempArray(19,i-1) then
tempArray2 = split(tempArray(27,i),",")
IF ubound(tempArray2) > 14 THEN
Response.write("All Sites Booked" )
ELSE
Response.write tempArray(27,i) & ", "
END IF
end if
ELSE
Response.Write "<tr>"
Response.Write "<td>" & tempArray(1,i) & ""
Response.Write "<td>" & tempArray(3,i) & ""
Response.Write " to " & tempArray(4,i) & ""
Response.write "<td>"
IF lcase(trim(tempArray(11,i)))&"" <> "not applicable!" THEN
Response.Write(tempArray(11,i))
END IF
Response.Write "<td>" & tempArray(19,i) & ""
Response.write "<td>"
tempArray2 = split(tempArray(27,i),",")
IF ubound(tempArray2) > 14 THEN
Response.write("All Sites Booked" )
ELSE
Response.write tempArray(27,i) & ", "
END IF
Response.write ""
'booking number isnt the same as above
end if
end if
next
%>
</TABLE>
<br>
<%
myRS.Close
Set myRS = nothing
conntemp.Close
Set conntemp = nothing
%>
<%
Dim conntemp1, myDSN1, myRS1, mySQL1, varBOOKINGNUMBER
Set conntemp1=Server.CreateObject("ADODB.Connection")
myDSN1 ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../fpdb/index.mdb")
conntemp1.open myDSN1
%>
<%
mySQL1 = "SELECT Count(ATTAWANDARON3.BOOKINGNUMBER) AS BOOKINGNUMBER FROM ATTAWANDARON3 GROUP BY BOOKINGNUMBER"
Set myRS1 = Server.CreateObject("ADODB.Recordset")
myRS1.Open mySQL1, conntemp1, 3 , 3
Dim BOOKINGNUMBERCount
BOOKINGNUMBERCount=myRS1.recordcount
%>
<%
myRS1.Close
Set myRS1 = nothing
conntemp1.Close
Set conntemp1 = nothing
%>
</table></body>
</html>
|
|
|
|