Re: Get and update only Time part from 'DateTime' data type field
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 09/13/04
- Next message: AMD Desktop: "Corrected: Need help with a query"
- Previous message: Aaron [SQL Server MVP]: "Re: Request : Whole word only"
- In reply to: Kumar: "Re: Get and update only Time part from 'DateTime' data type field"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 13 Sep 2004 18:05:36 +0200
> The table column already has a value in the form of '2004-04-15
> 17:45:30.0000'.
If the column is of the datetime datatype, then the above statement is incorrect. Datetime datatypes
doesn't have a format, the client application formats the value. More information at
http://www.karaszi.com/SQLServer/info_datetime.asp
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "Kumar" <Kumar@discussions.microsoft.com> wrote in message news:33597BA8-97BB-48B5-8C40-16E46D5E58CD@microsoft.com... > 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.. >> >> >>
- Next message: AMD Desktop: "Corrected: Need help with a query"
- Previous message: Aaron [SQL Server MVP]: "Re: Request : Whole word only"
- In reply to: Kumar: "Re: Get and update only Time part from 'DateTime' data type field"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|