havey
07-26-2005, 02:56 PM
can someone lookover the code below and let me know as to why the aa variable does not work in the IF statments, thanks from a newbie!
<%
DIM iDay
iDay = DatePart("w", Date())
SELECT CASE iDay
Case "1" strDayName = "Sunday"
Case "2" strDayName = "Monday"
Case "3" strDayName = "Tuesday"
Case "4" strDayName = "Wednesday"
Case "5" strDayName = "Thursday"
Case "6" strDayName = "Friday"
Case "7" strDayName = "Saturday"
END SELECT
aa = FormatDateTime(Time, vbShortTime) ' display format 18:34
'response.write aa
If iDay = "6" AND aa = "15:10" then %>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*3880);
else
setTimeout('location.href = location.href',1000*60*3880);
//--></script>
<%
response.write " Weekend Stop " & Date() & "..............." &Time()
ElseIf (iDay="1" OR iDay="2" OR iDay="3" OR iDay="4" OR iDay="5") AND (aa => "7:50") Then %>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*1);
else
setTimeout('location.href = location.href',1000*60*1);
//--></script>
<%
response.write " Update successful........................" & Date() & "..............." &Time()
ElseIf (iDay="1" or iDay="2" or iDay="3" or iDay="4") AND (cc = "15:10") Then
%>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*900);
else
setTimeout('location.href = location.href',1000*60*900);
//--></script>
<%
response.write " End Day Stop " & Date() & "..............." &Time()
End If %>
<%
DIM iDay
iDay = DatePart("w", Date())
SELECT CASE iDay
Case "1" strDayName = "Sunday"
Case "2" strDayName = "Monday"
Case "3" strDayName = "Tuesday"
Case "4" strDayName = "Wednesday"
Case "5" strDayName = "Thursday"
Case "6" strDayName = "Friday"
Case "7" strDayName = "Saturday"
END SELECT
aa = FormatDateTime(Time, vbShortTime) ' display format 18:34
'response.write aa
If iDay = "6" AND aa = "15:10" then %>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*3880);
else
setTimeout('location.href = location.href',1000*60*3880);
//--></script>
<%
response.write " Weekend Stop " & Date() & "..............." &Time()
ElseIf (iDay="1" OR iDay="2" OR iDay="3" OR iDay="4" OR iDay="5") AND (aa => "7:50") Then %>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*1);
else
setTimeout('location.href = location.href',1000*60*1);
//--></script>
<%
response.write " Update successful........................" & Date() & "..............." &Time()
ElseIf (iDay="1" or iDay="2" or iDay="3" or iDay="4") AND (cc = "15:10") Then
%>
<script language="JavaScript"><!--
if (document.images)
setTimeout('location.reload(true)',1000*60*900);
else
setTimeout('location.href = location.href',1000*60*900);
//--></script>
<%
response.write " End Day Stop " & Date() & "..............." &Time()
End If %>