Re: Cast: timestamp to integer - Mailing list pgsql-general

From Arjen van der Meijden
Subject Re: Cast: timestamp to integer
Date
Msg-id 003401c33104$88f9d350$3ac15e91@acm
Whole thread Raw
In response to Re: Cast: timestamp to integer  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
Why not use EXTRACT ?

Arjen

> -----Oorspronkelijk bericht-----
> Van: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] Namens Rory Campbell-Lange
> Verzonden: donderdag 12 juni 2003 18:58
> Aan: Michal Durys
> CC: pgsql-general@postgresql.org
> Onderwerp: Re: [GENERAL] Cast: timestamp to integer
>
>
> select cast(to_char(current_timestamp, 'd') as integer)/5;
>
> On 12/06/03, Michal Durys (joe@anime.com.pl) wrote:
> > I'd like to convert timestamp and date fields to intergers.
> > Unfortunately cast() says it's impossible:
> --
> Rory Campbell-Lange
> <rory@campbell-lange.net>
> <www.campbell-lange.net>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
http://archives.postgresql.org



pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Cast: timestamp to integer
Next
From: Steve Crawford
Date:
Subject: pg_conf idea (was Re: Postgres performance comments from a MySQL user)