RE: date
Posted in 1999
Topics: Server Administration
You must be careful when doing math with UNITS MONTH because of TODAY is
05/31/1999 then TODAY - 3 UNITS MONTH will be 02/31/1999. This will produce
"1267: The result of a datetime computation is out of range.". I have solved
this problem only by trapping the error in my error handler. Informix
technical support does not consider this a bug.
-----Original Message-----
From: robertb..vorbroker
[SMTP:robertb..vorbroker@cwix.com]
Sent: Tuesday, May 25, 1999 4:25 PM
To: informix-list@iiug.org
Subject: Re: date
In DBACCESS try
SELECT * from tablename where last_update < (TODAY - 3 units
month)
that should do it I think...
Rob Vorbroker
Min Kim <mkim@icpma.com> wrote in message
news:374AB582.342850CD@icpma.com...
> hi,
> can someone please tell me why "select * from tableName
where (TODAY -
> last_update < 3 units month)"
>
> does not work? it gives the error cannot convert between
types. can
> someone give me the syntax to get all records that are 3
months old or
> less?
>
> Min
>
In article <7ifeqo$508$1@news.xmission.com>, Howard, Paul <PaulHow@medcmp.com> wrote: >You must be careful when doing math with UNITS MONTH because of TODAY is >05/31/1999 then TODAY - 3 UNITS MONTH will be 02/31/1999. This will produce >"1267: The result of a datetime computation is out of range.". I have solved >this problem only by trapping the error in my error handler. Informix >technical support does not consider this a bug. Probably because it's ANSI-specified behavior for year-month interval arithmetic... -- Alan Denney yosemite at accesscom.com I killed Einstein. I had to -- he knew too much.