Looping Time
Hello to everyone and anyone. I'm new to ASP and to this forum.
Here's what I'm having a problem with. I need ASP to do the following:
(1) take the starttime in one database field (SQL Server), (08:00:00 AM)
(2) take the endtime in another database field (SQL Server), (05:00:00 PM)
(3) add 30 minutes to the starttime, and
(4) display the result of the each new starttime.
It needs to continue to do these steps until the new starttime is less than or equal to the endtime. My code produces an infinite loop for whatever reason. Here's my code.
<%
Dim strSatOpen
Dim strSatClosed
Dim strSatapptframe
Dim addTime
strSatOpen = ("8:00 AM")
strSatClosed = ("5:00 PM")
strSatapptframe = "30"
addTime = DateAdd("n",strSatapptframe,strSatOpen)
Do While addTime <= strSatclosed
Response.Write "<br>" & addTime
addTime = addTime + strSatapptframe
%>
Any and all help is greatly appreciated. :)
|