| From: | Michael Glaesemann <grzm(at)seespotcode(dot)net> |
|---|---|
| To: | "Lonni J Friedman" <netllama(at)gmail(dot)com> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: timestamp interval issue |
| Date: | 2007-10-05 23:48:23 |
| Message-ID: | 18126F8B-775C-4B10-9DC9-8C35323DE757@seespotcode.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Oct 5, 2007, at 18:46 , Lonni J Friedman wrote:
> Thanks. I gave this a try (cut & paste exactly what you provided), but
> I'm getting a syntax error at the final semicolon?
Ah. I forgot the END of the CASE statement. Give this a try:
select count(date_created)
from footable0
where case when current_time < '16:00'::time
then date_created between (current_date - 1) + interval
'16 hours'
and current_date + interval '16 hours'
else date_created between current_date + interval '16 hours'
and (current_date + 1) + interval '16
hours'
end;
Michael Glaesemann
grzm seespotcode net
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Lonni J Friedman | 2007-10-05 23:53:04 | Re: timestamp interval issue |
| Previous Message | Lonni J Friedman | 2007-10-05 23:46:37 | Re: timestamp interval issue |