If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DatePart
Keith wrote:
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. -- Marsh MVP [MS Access] |
#2
|
|||
|
|||
DatePart
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 |
#3
|
|||
|
|||
DatePart
Using the TimeValue worked perfectly!
Thank you Marshall. Keith "Marshall Barton" wrote: Keith wrote: 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. -- Marsh MVP [MS Access] . |
Thread Tools | |
Display Modes | |
|
|