Question:

Time Comparison Access VBA?

by  |  earlier

0 LIKES UnLike

Greetings,

I am trying to compare time stored in two variables as strings namely TOI and TR. Can someone show me a function or something that I can use to compare and see which of the two is great, less, or equal? Any help will be appreciated.

- TKN

 Tags:

   Report

2 ANSWERS


  1. Try evaluating the DateDiff function for the relevant time interval.  Consider "#" & string & "#".


  2. You use the DateDiff function, but you need to use the DateValue function if your times are strings

    DateDiff("s", DateValue(TOI), DateValue(TR))

    The returned value is +ve if TOI is prior to (less than) TR

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions