Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Urgently Need Help with ASP Loop & Display Script
Old 03-19-2005, 05:14 PM Urgently Need Help with ASP Loop & Display Script
Junior Talker

Posts: 1
Trades: 0
Hello everyone and anyone. I'm new to ASP and this forum. So please bear with me. I had someone help me with this script which works great. It's purpose is to (1) generate times in time given increments and (2) compare these times to data in a particular database field (MSSQL). If any of the generated times match the database data, the matching generated times are not to display. I attempted to tweak it a little to see if I could do this. Here's the code:

<%
Dim varSatOpen
Dim varSatClosed
Dim varSatapptframe
Dim addTime
Dim newTime 'what I added
Dim whatTime 'what I added

dim dt() : redim dt(-1)

varSatOpen = ("08:00:00")
varSatClosed = ("17:00:00")
varSatapptframe = "30"
addTime = dateadd("h",cint("0"),varSatOpen)
response.write addtime
newTime = ("09:00:00") 'what I've added
whatTime = dateadd("h",cint("0"),newTime) 'what I've added

Do While addTime < dateadd("h",cint("0"),varSatclosed)
addTime = DateAdd("n",cint(varSatapptframe),addTime)
redim preserve dt(ubound(dt)+1)
dt(ubound(dt))=addTime
If whatTime <> dt(ubound(dt)) Then 'what I've added
response.write replace(string(1," ")," ","<br/>") & dt(ubound(dt)) 'part of original script
End If 'what I've added
Loop
%>

It works fine until the variable "newTime" is changed to times such as "08:00:00", "08:30:00", or "14:30:00". These times continue to display when they shouldn't. Any ideas what I've done wrong?

Again, any and all help is greatly appreciated.
pupadu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Urgently Need Help with ASP Loop & Display Script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13580 seconds with 12 queries