parsing a date and time field

F

freeriderxlt

I have a date and time field that I downloaded from a database. It
come across looking like the following:
"02/1/2009 14:37". I want to seperate the time from the date. When I
to to "Text to Columns" and parse the field it changes it to three
columns looking like this: "02/1/2009 0:00", "2:37 AM", "PM" I parsed
based on "Space delimiter". I am looking for suggestions on how to get
the correct time to display.
 
S

Shane Devenshire

Hi,

You are parsing as Delimited. I think you should use Fixed Width and then
put one line between the date and time.
 
P

Pete_UK

Assuming your date/times are in A1, then this will give you only the
date part:

=INT(A1)

and this will give you only the time part:

=MOD(A1,1)

Format the cells accordingly, then copy these down as required.

Hope this helps.

Pete
 
F

freeriderxlt

Assuming your date/times are in A1, then this will give you only the
date part:

=INT(A1)

and this will give you only the time part:

=MOD(A1,1)

Format the cells accordingly, then copy these down as required.

Hope this helps.

Pete



- Show quoted text -

The "=INT(a1) and =MOD(a1,1) solution worked, thank you.
The other solutions of using fixed width does not work because the
date and time fields vary and a straight line would cut off some
data.

Thanks for all the interest and suggestions.
 

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

Top