convert a string to time formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble converting #### string to a date/time formatted field.
I'm looking for a hh:nn result.

If I change the table format from text to date/time I get "#error" results.
other conversions yield 0000 in the field.
 
scott said:
I'm having trouble converting #### string to a date/time formatted
field. I'm looking for a hh:nn result.

If I change the table format from text to date/time I get "#error"
results. other conversions yield 0000 in the field.

How about posting some of the data, just the years, you are trying to
convert.

I don't think Access will know what a four character string is in terms
of date. DDMM? MMYY? YYYY etc.?
 
I'm having trouble converting #### string to a date/time formatted field.
I'm looking for a hh:nn result.

If I change the table format from text to date/time I get "#error" results.
other conversions yield 0000 in the field.

Try:

TimeValue(Val(Left([timestring], 2)), Val(Mid([timestring], 3, 2))

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top