Article View: borland.public.interbase.sql
Article #11205Re: Extract the Time Out of DateTime field
From: Ivan Prenosil
Date: Wed, 11 Dec 2002 10:54
Date: Wed, 11 Dec 2002 10:54
20 lines
1504 bytes
1504 bytes
> Can somebody tell me how to extract the time value from a Datetime field > > For now I use : > SELECT EXTRACT(HOUR FROM MYDATETIME) || ':' || > EXTRACT(MINUTE FROM MYDATETIME) > > FROM MYTABLE > > the MYDATETIME value = 25-11-2002 19:01:00 > the result will be 19:1 > > What I'm looking for = 19:01 instead of 19:1 Do you really need result converted to string ? I always prefer return correct datatype and format it on client: SELECT CAST(MYDATETIME AS TIME) FROM ... -- Ivan http://www.volny.cz/iprenosil/interbase
Technical Details
Message-ID:
<3df71980@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3df64a89$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,f123919f75f61b5f X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-11 03:10:04 PST From: "Ivan Prenosil" <prenosil@ms.anet.cz> Newsgroups: borland.public.interbase.sql References: <3df64a89$1@newsgroups.borland.com> Subject: Re: Extract the Time Out of DateTime field Date: Wed, 11 Dec 2002 11:54:14 +0100 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 194.108.237.175 Message-ID: <3df71980@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1039604096 194.108.237.175 (11 Dec 2002 02:54:56 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail