Skip site navigation (1) Skip section navigation (2)

Re: how to cast for dates/datetimes?

From: "D(dot) Duccini" <duccini(at)backpack(dot)com>
To: Frank Bax <fbax(at)execulink(dot)com>
Cc: Pgsql-novice <pgsql-novice(at)postgreSQL(dot)org>
Subject: Re: how to cast for dates/datetimes?
Date: 2000-08-22 14:05:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
> I suspect that your calculation yeilds a timestamp instead of date because
> 'now' is a timestamp, not a date, try:
> select sum(total) from lineitemsnext where date <= ('now'::date + '1
> month'::timespan)::date;

This one did the trick.  I'll try the other variants later on.



david(at)backpack(dot)com            BackPack Software, Inc.
+1 651.645.7550 voice       "Life is an Adventure.    
+1 651.645.9798 fax            Don't forget your BackPack!"   

pgsql-novice by date

Next:From: Ryan WilliamsDate: 2000-08-22 17:16:22
Subject: Unsigned?
Previous:From: Dave_PfaltzgraffDate: 2000-08-22 12:03:52
Subject: Re: how to cast for dates/datetimes?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group