.TO_CHAR problem

From: Guillaume Lémery <glemery(at)comclick(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: .TO_CHAR problem
Date: 2001-02-15 14:59:21
Message-ID: 3A8BEEC9.4090707@comclick.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I want to have some stats from my data grouped by 2hours periodes.

Here is the query :

SELECT TO_DATE(TO_CHAR (date_clic,'DD-MM-YYYY ')
|| (TO_CHAR(
TO_NUMBER(
TO_CHAR(date_clic,'hh24')
, 99)
- mod(
TO_NUMBER(
TO_CHAR(date_clic,'hh24')
, 99)
,2)
, 'hh24')
)
||':00','DD-MM-YYYY HH24:MI') AS date_debut
FROM clic_campagne;

But I only get the date whithout the hours and the minute, how can I get
them ?

Thanx,

Guillaume.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2001-02-15 15:00:07 last UPDATE or INSERT time of a table?
Previous Message Tom Lane 2001-02-15 14:39:49 Re: Postmaster crashes