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


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..
>>
>>
>> 


Relevant Pages

  • Re: Can I AutoSize (or Fit) merged, variable data within a text bo
    ... i have had to manually format my pages as they ... "Peter Jamieson" wrote: ... The problem became a problem when my client decided that they no ... PrintShop Mail is made for this kind of gig ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Exchange 2003 Performance issues with Entourage Clients
    ... the format the client retrieves/submits it. ... "working directory" or the system temp directory. ... users on the store, I'm guessing it's the IO for content conversion in the ...
    (microsoft.public.exchange.admin)
  • RE: I cant get data into a column type format needed
    ... somehow it is not quite working for me in the format I ... client information. ... and the supervisor name of that SC. ... Service Coordinator they belong ...
    (microsoft.public.access.reports)
  • Re: Passing parameters from page to page in HTA app
    ... I just have to learn how to output to that format. ... >> When they select edit it should passs them into the next portion which ... >> itinerary for that event as well as add client names to the event. ... >> pass them to a third page to edit individual client itinerarys. ...
    (microsoft.public.scripting.jscript)
  • Re: embeds vs attachments
    ... only Outlook RTF format is the problem as only 2 mail clients can ... HTML has its own problems as many people routinely block HTML mail or use a ... client that cannot read HTML. ...
    (microsoft.public.outlook)