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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help converting time to double

Status
Not open for further replies.

diddydustin

Programmer
Jul 30, 2002
181
US
hey guys,

CInt(TimeTotal) is giving me a type mismatch error.

TimeTotal = "01:00:00", and i've also tried #01:00:00#.

how do i properly convert this value to a double? it signifies one hour, but it could be any range of hours minutes and seconds up to 24.

thank you!
dustin
 
Hi

I note you have asked several questions relating to date/time and the conversion thereof

the date/time type allows you to record what I would describe as points in time, eg 10:00am on the 13/04/2004

Your latest question suggests to me that you are trying to store and/or manipulate an elapsed time (eg 90minutes or 1.5 hours etc).

In my opinion, such things are best held as simple numbers (integres, or longs), to represent (say) number of elapsed minutes, or hours (choice of unit depends on the situation, do you want accuracy to the second, or to the nearest day or even year, depends on what you are measuring)

Useful functions in this area are DateDiff() and possibly DateAdd()

If I am on the wrong track, sorry to have wasted your time

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top