DatePart

K

Keith

I'm trying to convert "mm/dd/yyyy hh:nn:ss" date format to just time using
DatePart function.

I've used DatePart("hh:nn",[TimeIn]) and it returns "Error".

I've used TEMP: DatePart("h",[TimeIn]) & ":" & DatePart("n",[TimeIn]) and it
returns the time; however, I can't compare the result to other time since it
returns the results in text format.

Any suggestions?


Keith
 
K

Keith

Using the TimeValue worked perfectly!

Thank you Marshall.


Keith

Marshall Barton said:
Keith said:
I'm trying to convert "mm/dd/yyyy hh:nn:ss" date format to just time using
DatePart function.

I've used DatePart("hh:nn",[TimeIn]) and it returns "Error".

I've used TEMP: DatePart("h",[TimeIn]) & ":" & DatePart("n",[TimeIn]) and it
returns the time; however, I can't compare the result to other time since it
returns the results in text format.

That would be a complicated way to get the time part of a
date/time value. Try using the TimeValue function instead.
 

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