ADSM-L

Re: [ADSM-L] date check in a select

2010-02-11 12:47:02
Subject: Re: [ADSM-L] date check in a select
From: Michael Green <mishagreen AT GMAIL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 11 Feb 2010 19:45:33 +0200
Try this:
select node_name, reg_time from nodes where
cast((current_timestamp-reg_time)days as decimal)>30
--
Warm regards,
Michael Green


On Thu, Feb 11, 2010 at 6:46 PM, Richard Rhodes
<rrhodes AT firstenergycorp DOT com> wrote:
>
> What's the best way to write a date check like this?    I'm looking
> for any nodes registered after some number of days (the 30 is just an
> example).
>
> dsmadmc -se=$i -id=$adminid -password=$adminpwd -tab -noc <<EOD
>      select node_name, reg_time from nodes  where reg_time \> 30 days
> EOD
>
>
> ANR2916E The SQL data types TIMESTAMP and INTERVAL DAY(9) are incompatible
> for operator '>'.
>
>                                                              |
>         .....................................................V........
>         select node_name, reg_time from nodes where reg_time > 30 days
>
>
>
> Thanks
>
> Rick
>
> -----------------------------------------
> The information contained in this message is intended only for the
> personal and confidential use of the recipient(s) named above. If
> the reader of this message is not the intended recipient or an
> agent responsible for delivering it to the intended recipient, you
> are hereby notified that you have received this document in error
> and that any review, dissemination, distribution, or copying of
> this message is strictly prohibited. If you have received this
> communication in error, please notify us immediately, and delete
> the original message.