Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Min Kim asked why a WHERE clause using TODAY - last_update < 3 units month failed with a cannot convert between types error, and how to select records three months old or less. Carlson suggested today - date(last_update) < 90. Rob Vorbroker suggested last_update < (TODAY - 3 units month). John Bejarano suggested using CURRENT (datetime) instead of TODAY (date). No confirmation of which worked.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Min Kim — — source: Informix-list mailing list archive (1991-1998)
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
↪ replying to Min Kim
Carlson@WHSmith — — source: Informix-list mailing list archive (1991-1998)
What about
select * from Table
where today - date(last_update) < 90
John Carlson
Informix DBA
WHSmith USA
Min Kim wrote:
>
> 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
>
> ------------------------------------------------------------------------
>
> Name: mkim.vcf
> mkim.vcf Type: VCard (text/x-vcard)
> Encoding: 7bit
> Description: Card for Min Kim
↪ replying to Min Kim
robertb..vorbroker — — source: Informix-list mailing list archive (1991-1998)
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
>
↪ replying to Min Kim
John Bejarano — — source: Informix-list mailing list archive (1991-1998)
Min,
Instead of using 'TODAY', which is of data type date, try using 'CURRENT'
which is of data type datetime year to fraction(5).
Kind regards,
John Bejarano.
Min Kim wrote in message <374AB582.342850CD@icpma.com>...
>hi,
>can someone please tell me why "select * from tableName where (TODAY -
>last_update < 3 units month)"
>
>does not work?
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.