text to time conversion

andybrst

New Member
Joined
Jan 24, 2003
Messages
45
I've been banging my head against this problem for ages. regretably, in their wisdom, my company purchased software which records times as text without preceding zeros. ie. 9am is recorded as 900, whereas 10am is recorded as 1000.

Using format in the query properties I can show it as 09:00, but I need to concatenate to a date field to create a date/time stamp. When I have attempted this, the data refers back to 900.

When I have used TimeValue, data ending 00 comes back as an error and data recorded as like 1030 come back as 10:03!!

Help

:oops: Andy
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Time is handled as fractions of a day. You'll need to calculate the number of seconds represented by your text values (eg: 900 is 9 hours, 00 minutes, or 9*3600 seconds). Divide this by 86400, the # of seconds in a day, and format the result as Date/Time.

Denis
 
Upvote 0

Forum statistics

Threads
1,221,683
Messages
6,161,264
Members
451,692
Latest member
jmaskin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top