Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case help 1

Status
Not open for further replies.

MisterC

IS-IT--Management
Apr 19, 2001
501
US
Hi,
With a Select Case statement, I'm attempting to use:
[blue]Case #11:59 AM# TO #1:01 PM#[/blue]
This works fine in VB6, but not in VBScript. Is there a replacement for the "TO"?
 
TO is not valid in VBScript Select..Case statements.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Thanks Tom, Yes I know.
Is there a replacement?
 
Just using a bunch of If...Thens.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
What about something like this ?
If myTime >= #11:59 AM# And myTime <= #1:01 PM# Then

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This is what I ended up with:
Code:
if curtime > #5:00 PM# or curtime < #8:45 AM# then
  ...
elseif curtime > #11:59 AM# and curtime < #1:30 PM# then
  ...
else
  ...
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top