Re: Date help

From: "Garrett Murphy" <gmurphy(at)lawlogix(dot)com>
To: "PostgreSQL - Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Date help
Date: 2010-10-05 02:49:41
Message-ID: 076DC33A3D38CE4BBC64D35DDD9DE70C0B13892F@mse4be2.mse4.exchange.ms
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> Hi List,
>
> This should be simple but though reading the doc's can't figure it out
- I'm
> hopeless at intrepreting documentation.
>
> I just want to extract from a table containing entries with dates, all
entries
> from within a specified interval eg last month, or last 10 days.
>
> Any help appreciated.
>
> Richard

Your post isn't the clearest, but there are a few ways of accomplishing
this. Probably the easiest is:
...WHERE date_field>=(CURRENT_DATE-INTERVAL '10 days')
...WHERE date_field>=(CURRENT_DATE-INTERVAL '1 month')
And so on.

In response to

  • Date help at 2010-10-05 01:58:32 from richard terry

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message richard terry 2010-10-05 04:01:21 Re: Date help
Previous Message richard terry 2010-10-05 01:58:32 Date help