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

TimeValue

Status
Not open for further replies.

muffntuf

MIS
Joined
Jan 7, 2003
Messages
155
Location
US
I am trying to pull a time from a text field that will convert to a time value. It is in military time 24:00. The formula I am using is:

Time:timevalue(format([timefield],"@@\:@@")

This catches everything except any time from 00 hours to 1:00 am (midnight to one o'clock in the morning). So if the time is :40 I am getting #Error, everything else converts fine.

How do I get the formula to catch the 00 hours to 1:00 am?

Thanks!
 
Skip,

Thanks I have tried the "hh:nn" format. It does not pick up the 00 to 59 minutes. It is only picking up the the hour and minutes. 1:49 PM.

Any other ideas?

Thanks,
Muffntuf
 
I do not understand. I went into an Access database and formatted a date/time. Then in a query formatted and expression to display ONLY the time.

My source data was
1/1/2001 00:49:00

My result was
00:49

using...
Expr1: Format([StartDate],"Short Time")

as the format (which I entered as
Expr1: Format([StartDate],"hh:nn") Skip,
Skip@TheOfficeExperts.com
 
You do know that Time values in Excel and Access are values between 0 and 1.

So 01:00 is 1/24 or 0.041666667

BYW, military time does not use AM and PM. Skip,
Skip@TheOfficeExperts.com
 
You are right. Military time does not, but it shows up automatically. I think the problem you are missing is the format condition. This field is a text field not a date/time field, and it only contains the times. That is why I am having problems bringing all of the times. So I get everything that is past 1:00 am in the morning to work, just not the 00 to 59 minutes.
 

bS_TIME: (Format(TimeValue([bstime]),=hh/24:nn/60/24))??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top