Im writing a pretty simple bit of code, for an events calendar. the following part is simply where the calendar is output into the web page.
Code:
  	For iRowsLoop = 1 to iRows
		Response.Write "<tr>"
		For iColumnsLoop = 1 to iColumns
			iDay = aCalendarDays((iRowsLoop-1)*7 + iColumnsLoop)
			If iDay > 0 Then
				Response.Write "<td valign='top' align='right' width='14%' Height=" & FormatPercent(1/iRows,0) & " bgcolor='#4e4e85' class='copyright'>"
				Response.Write "<table cellspacing='0' cellpadding='0' border'0' width='100%'>"
					Response.Write "<tr><td align='right'><b>"
					Response.Write iDay
					Response.Write "</b></td></tr>"
					If Not events.EOF then
						If events("Day") = iDay Then
							Response.Write "<tr><td valign='top' align='left'>"
							Response.Write "<font size='2'>"
							Response.Write events("Day")
							events.MoveNext
							iEventCount = iEventCount + 1
							Response.Write "</font>"
							Response.Write "</td></tr>"
						End If
					End If
					Response.Write "</table>"
					Response.Write "</td>"
			Else
				Response.Write "<td bgcolor='black'>&nbsp;</td>"
			End If
		Next
		Response.Write "</tr>"
	Next
Everything works fine, up to the line:
Code:
If events("Day") = iDay Then
Now, events("Day") is obviously where Ive got the data from the DB, and iDay is the day of the calendar. Now when these 2 are the same, eg the 23 day of the month, it should output that there is an event on that day.

Trouble is, it doesnt.
The 2 values get to be the same, eg both = 23, but the If statement does not recognise this!!

Any ideas anyone, coz I'm well and truly stumped?