If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Time in ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-04, 05:23
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
Time in ASP

Assume that all of time was kept in variable which is array like this. Note that tiorder is time

tiorder2(t2)=rst5("tiorder")


sql="select top 1 * from ("&namecompany2(i2)&") where price <= "&limitprice2(j2)&" and ti > #&tiorder2(t2)&#"

The problem is ti > #&tiorder2(t2)&#" it doesn't work



Note that tiorder2(t2) keep time
Reply With Quote
  #2 (permalink)  
Old 09-26-04, 19:45
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I think you are trying for something like....
Code:
ti > "#" & tiorder2(t2) & "#"
Actually you are probabyl better to go with a CDate idea like...
Code:
CDate(ti) > CDate(tiorder2(t2))
At least then you know you are comparing two dates...

Last edited by rokslide; 09-27-04 at 00:22. Reason: Rethink.....
Reply With Quote
  #3 (permalink)  
Old 09-27-04, 05:43
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
The type of time that I use in column ti is date/time hh:nn:ssAM/PM
Id ti
1 9:00:01AM
2 10:00:01AM
3 10:12:45AM
4 10:30:01AM
Reply With Quote
  #4 (permalink)  
Old 09-27-04, 19:06
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
errgghhh.... that's not good.... okie, something that will work.... (although there may be better ways, I haven't played much with time values)

reformat your time to 24 hour using something like...
Code:
24Hour(ti) > 24Hour(tiorder2(t2))

Function 24Hour (myTime)
  arrTime = split("9:00:01AM",":")
  AMPM = mid(arrTime(2),3)
  myHour = arrTime(0)
  myMinute = arrTime(1)
  mySecond = left(arrTime(2))

  if AMPM="PM then myHour = myHour +12

  24hour = myHour & myMinute & mySecond
end function
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On