Re: Get and update only Time part from 'DateTime' data type field

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Kumar (Kumar_at_discussions.microsoft.com)
Date: 09/13/04


Date: Mon, 13 Sep 2004 07:13:02 -0700

Adam,

The table column already has a value in the form of '2004-04-15
17:45:30.0000'.
My boss wants to convert this in the same table column as '5:45:30 PM'.

I need to change in the database table, nothing to do with client / report /
interface
applications.

Very strange request, I need to figure something. The table coumn is now
defined as 'datetime', but we can change to any other format.

Thanks for your help.

"Adam Machanic" wrote:

> Kumar,
>
> 05:45:30 PM is the same value as 17:45:30, with a different format. The
> update you need is to your client display, not your data.
>
>
> "Kumar" <Kumar@discussions.microsoft.com> wrote in message
> news:782BB7AA-F930-4D13-9D90-0C04B0D372F7@microsoft.com...
> > Can you give me a SQL syntax or query to select only 'Time' portion from a
> > table column which is defined as 'datetime'. ( 8 char length)
> >
> > Also, I need to update this field (same table) with only time part.
> >
> > e.g: '2004-04-15 17:45:30.0000' (Existing value in the table column)
> > '05:45:30 PM' (Required value in the same table coumn
> > after update)
> >
> > Cheers..
>
>
>