Re: TIME column manipulation/comparison hangups

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Bill Moran" <wmoran(at)collaborativefusion(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: TIME column manipulation/comparison hangups
Date: 2008-11-03 19:11:23
Message-ID: dcc563d10811031111o2035abf4w7596f8f21c42f9c3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran
<wmoran(at)collaborativefusion(dot)com> wrote:
>
> I'm trying to test the time in a time column to see if it's the same
> minute as the current time. I wouldn't have thought this would be
> difficult:
>
> WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI')

Use date_trunc

where date_trunc('minute',timefield)=date_trunc('minute',now());

I might have the args backwards.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Hodgson 2008-11-03 19:21:07 Re: Debugging infrequent pegged out CPU usage
Previous Message Raymond O'Donnell 2008-11-03 19:10:20 Re: TIME column manipulation/comparison hangups