Fun with Dates - Mailing list pgsql-sql

From Mark Fenbers
Subject Fun with Dates
Date
Msg-id 508F0576.4020404@noaa.gov
Whole thread Raw
Responses Re: Fun with Dates
List pgsql-sql
Greetings,<br /><br /> I want to be able to select all data going back to the beginning of the current month.  The
followingportion of an SQL does NOT work, but more or less describes what I want...<br /><br /> ... WHERE obstime >=
NOW()- INTERVAL (SELECT EXTRACT (DAY FROM NOW() ) ) + ' days'<br /><br /> In other words, if today is the 29th of the
month,I want to select data that is within 29 days old... WHERE obstime >= NOW() - INTERVAL '29 days'<br /><br />
Howdo I craft a query to do use a variable day of the month?<br /><br /> Mark<br /> 

pgsql-sql by date:

Previous
From: David Johnston
Date:
Subject: Re: pull in most recent record in a view
Next
From: Thomas Kellerer
Date:
Subject: Re: Fun with Dates