PC Review


Reply
 
 
Keith
Guest
Posts: n/a
 
      4th Jun 2010
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
 
Reply With Quote
 
 
 
 
Keith
Guest
Posts: n/a
 
      4th Jun 2010
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]
> .
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DatePart =?Utf-8?B?TUJyYXNzZWw=?= Microsoft Access Reports 1 20th Jul 2006 12:29 AM
Using BETWEEN AND with DatePart =?Utf-8?B?ZGxtYWxleQ==?= Microsoft Access Queries 1 13th Jul 2006 06:39 PM
Re: DatePart John Spencer (MVP) Microsoft Access Queries 0 11th May 2004 01:08 AM
Get DatePart Tausif Alam Microsoft Access Queries 2 15th Apr 2004 12:31 PM
datepart mikk Microsoft Access Queries 1 13th Nov 2003 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:51 AM.