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
Richard,
the column reg_time is in datetime format so you need to 'cast' it into the
correct format. Further, you are comparing against an integer. What you
probably want is:
select node_name, date(reg_time) from nodes \
where cast(current_date - date(reg_time) as integer) 30
the first date()
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
rrho...@firstenergycorp.com wrote:
What's the best way to write a date check like this? I'm looking
for
I use this variant: [?equivalent to M.Green's?]
select node_name, reg_time from nodes-
where days(current_timestamp)-days(reg_time)30
--
jim.o...@yale.edu (w#203.432.6693, c#203.494.9201, h#203.387.3030)
Michael Green wrote:
Try this:
select node_name, reg_time from nodes where