X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B913B9FA5C3 for ; Wed, 14 Jun 2006 01:29:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 00627-05 for ; Wed, 14 Jun 2006 01:29:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from weatherbeeta.com.au (mail.weatherbeeta.com.au [202.154.127.242]) by postgresql.org (Postfix) with SMTP id F2E2F9FA3C0 for ; Wed, 14 Jun 2006 01:29:09 -0300 (ADT) Received: (qmail 17139 invoked from network); 14 Jun 2006 04:29:05 -0000 X-NetworkBox-HamSign: 0101;OUT;wbeetaau1;76beaf4c45fc502c16d32e2e828892c4; Received: from mail.weatherbeeta.com.au (HELO wb-email) (172.20.0.2)by network-box.weatherbeeta.com.au with SMTP; 14 Jun 2006 04:29:05 -0000 Received: from IT-PHIL ([172.20.0.155]) by wb-email (602Pro LAN SUITE 2003) id 2d530870 for pgsql-sql@postgresql.org; Wed, 14 Jun 2006 14:26:45 +1000 Reply-To: From: "Phillip Smith" To: Subject: Re: to_char with time Date: Wed, 14 Jun 2006 14:27:41 +1000 Organization: Weatherbeeta P/L Message-ID: <007901c68f6a$f8c89c80$9b0014ac@ITPhil> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_007A_01C68FBE.CA74AC80" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 In-Reply-To: <20060614040934.1411.qmail@web54313.mail.yahoo.com> Importance: Normal X-Scanned-By-wbeetaau1: Virus scan performed by network-box X-Scanned-By-wbeetaau1: Scanner file id is wbeetaau1-1150259345.440-17129-000 X-Scanned-By-wbeetaau1: No known viruses found in message (received+scanned in 0.04/0.12 secs) X-Scanned-By-wbeetaau1: Spam-Check-Result: No, hits=0 required=7 tests= autolearn=no version=2.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/150 X-Sequence-Number: 25386 This is a multi-part message in MIME format. ------=_NextPart_000_007A_01C68FBE.CA74AC80 Content-Type: text/plain;charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Try using current_timestamp instead of current_time. This works for me = in a SELECT: to_char(current_timestamp + '1 MONTH AGO', 'YYMM') as 'reference' =20 Cheers, -p =20 -----Original Message----- From: pgsql-sql-owner@postgresql.org = [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of chester c young Sent: Wednesday, 14 June 2006 2:10 PM To: pgsql-sql@postgresql.org Subject: [SQL] to_char with time =20 this does not work: select to_char(current_time,'HH24:MI') what am I missing? is it possible to format a time column in a select? thanks, stumped, aka, chester __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around=20 http://mail.yahoo.com=20 *******************Confidentiality and Privilege Notice******************* The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments ------=_NextPart_000_007A_01C68FBE.CA74AC80 Content-Type: text/html;charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Try using current_timestamp instead = of current_time. This works for me in a SELECT:

to_char(current_timestamp + '1 MONTH AGO', 'YYMM') as = ‘reference’

 

Cheers,

-p

 

-----Original = Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] = On Behalf Of
chester c young
Sent:
Wednesday, 14 June 2006 2:10 PM
To: = pgsql-sql@postgresql.org
Subject: [SQL] to_char = with time

 

this does not = work: select to_char(current_time,'HH24:MI')

what am I missing?  is it possible to format a time column in a = select?

thanks,
stumped, aka,
chester

 ________________________________________= __________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments
------=_NextPart_000_007A_01C68FBE.CA74AC80--