________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
But you need to use Date Variables for the time or use 24 hour format, as 9:00 is strictly 9:00 AM.
Same as doing this:
CDate("3:00" which is always 3:00 AM.
The same will happen with
lblduration= CDate(CDate(txtTo) - CDate(txtFrom))
You can see this clearly on a machine set in 24 hour time format.
So, everything should work fine if you either use a 24 hour time format when working with strings, or use a date variable.
This is where it is a must to store time in a db field in a date/time field, and not in a text field, unless you have a 24 hour identifier such as 2 digit hours or using the AM/PM identifier.
Same holds true for user input.
Who knows what they mean when they input 3:00, unless they can select AM/PM or know that 3:00 is really 03:00.
jass1220, you need to be a little more observant.
Schweiger did give you a second choice so you only needed to use that, or a variant of that, such as using just "h".
For this, the Hour() or Minute function would be better though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.