
January 22nd, 2001, 03:58 PM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: Annapolis, Maryland US
Posts: 113
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
Hey all,
Does anyone know of a corresponding Postgres to_days() type function as exists in MySQL?? ....trying to get the total number of records between now() and 30 days ago by referencing the "posted" column of a table.
The following works....
> SELECT * from table_name
> WHERE trim(substr(now()-posted, 1, 2))::integer <= 30;
...but just wondering if there was anything more direct.
Thanks in advance,
Kyuzo
Nou ga aru taka wa tsume o kakusu
[Edited by Kyuzo on 01-22-2001 at 03:00 PM]
|