troubleshooting Question

time range in 24h format

Avatar of abangbatax
abangbatax asked on
Visual Basic Classic
1 Comment1 Solution195 ViewsLast Modified:

how to code time range in vb?


i got 3 workers, named A, B, and C

A work from 8 AM to 4 PM
B work from 4 PM to 12 AM
C work from 12 AM to 8 AM

what i want is a string called "worker" will automatically change depend on the time

here my code ( i guess its wrong )

dim worker as string

if time >= "08:00" and time <= "16:00" then worker = setting.text28.text
if time >= "16:00" and time <= "00:00" then worker = setting.text29.text
if time >= "00:00" and time <= "08:00" then worker = setting.text30.text

how to code the correct one?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros