Re: [GENERAL] date problem

2005-05-16 Thread tony
Le lundi 16 mai 2005 à 09:44 +0100, Richard Huxton a écrit : > > works for one record but other fields I need must be in aggregate or > > grouped. Is there a simple SQL request to get the most recent records > > from a set of joined tables? > > SELECT * FROM expo WHERE date = (SELECT max(date) FR

Re: [GENERAL] date problem

2005-05-16 Thread tony
Le lundi 16 mai 2005 à 10:30 +0200, Roman Neuhauser a écrit : > select * > from expo > where date = (select max(date) > from expo > where date < now()) as x; Thanks! I keep forgetting this for some strange reason... I was putting it in the "from" i

Re: [GENERAL] date problem

2005-05-16 Thread Richard Huxton
tony wrote: Hi, I thought this would be a classic sort of query but google did no give me the answer. I am attempting to select records where one of the dates is the latest date before today select max(date) from expo where date < now() works for one record but other fields I need must be in aggreg

Re: [GENERAL] date problem

2005-05-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-05-16 09:48:08 +0200: > I am attempting to select records where one of the dates is the latest > date before today > > select max(date) from expo where date < now() > > works for one record but other fields I need must be in aggregate or > grouped. Is there a simple SQL

[GENERAL] date problem

2005-05-16 Thread tony
Hi, I thought this would be a classic sort of query but google did no give me the answer. I am attempting to select records where one of the dates is the latest date before today select max(date) from expo where date < now() works for one record but other fields I need must be in aggregate or g

RE: [GENERAL] Date problem

2000-03-13 Thread JT Kirkpatrick
can also use the current_date function: select (current_date)+3; jt -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Monday, March 13, 2000 9:34 AM To: edNET System Admin Cc: [EMAIL PROTECTED] Subject:Re: [GENERAL] Date problem i'm not

Re: [GENERAL] Date problem

2000-03-13 Thread kaiq
that is the problem: you got to use select, otherwise, nothing to do with PG. if you really mean to ask perl to do it, there is a very powerful module (like PG's datetime feature) in perl (search CPAN by date)--I almost used it, but since PG is so good at datetime (timestamp/interval), I'm lazy.

Re: [GENERAL] Date problem

2000-03-13 Thread Jose Soares
Try using standard sql: hygea=# select current_date + interval '3 days';     ?column?  2000-03-16 00:00:00+01     edNET System Admin wrote: Hi, I'm trying to do something with dates which is proving to be a bit tricky. I'm trying to get the current "date" and add 3 da

Re: [GENERAL] Date problem

2000-03-13 Thread hikmat
i'm not sure about perl but a way to do it i psql: select (now()+'3 days') from anytable; Thu 16 Mar 15:34:12 2000 i did it today(monday) On Sun, 12 Mar 2000, edNET System Admin wrote: > Hi, I'm trying to do something with dates which is proving to be a bit > tricky. > > I'm trying to get

Re: [GENERAL] Date problem

2000-03-12 Thread Ross J. Reedstrom
On Sun, Mar 12, 2000 at 09:40:43PM -0500, Alex Pilosov wrote: > now() is a function, and you should use it as now() > > -alex also, the magic constant 'now' might work: it needs the tics as well. Ross -- Ross J. Reedstrom, Ph.D., <[EMAIL PROTECTED]> NSBRI Research Scientist/Programmer Comput

Re: [GENERAL] Date problem

2000-03-12 Thread Alex Pilosov
now() is a function, and you should use it as now() -alex On Sun, 12 Mar 2000, edNET System Admin wrote: > Hi, I'm trying to do something with dates which is proving to be a bit > tricky. > > I'm trying to get the current "date" and add 3 days to this. > > > I've tried: > > $date = "(now::d

[GENERAL] Date problem

2000-03-12 Thread edNET System Admin
Hi, I'm trying to do something with dates which is proving to be a bit tricky. I'm trying to get the current "date" and add 3 days to this. I've tried: $date = "(now::date) + ('3 days'::interval)"; DBD::Pg::st execute failed: ERROR: parser: parse error at or near "3" ... and : $date = "(n