Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 24 hour query
Shouls work as you have it now. Sysdate is the date/time as of when you
execute the query. Subtracting 1 from it gives you the prior day (current
time - 24 hours). So you do have it right. To confirm do:
select to_char(sysdate-1,'mm/dd/yyy hh24:mi:ss') from dual;
It will give you now - a day.
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Shawn Edwards" <spedwards_at_qwest.net> wrote in message news:4LEZ9.460$2x3.134386_at_news.uswest.net...Received on Tue Jan 28 2003 - 21:25:46 CST
> Hi,
>
> I run the below query at 12:00AM to update all events on our database with
a
> certain status_code and those
> that are older than the previous day. I need to change it so that I can
run
> it at anytime and it will update those
> events that are 24 hours and older. For example; I run it at 9AM Tuesday
> and it updates all events with that
> designated status_code that are older than 9AM Monday. I'm not sure if I
> explained it that well but and hints
> would be greatly appreciated.
>
> update disb_basic
> set status_code = 'CANCELLED'
> where status_code = 'PPTINIT'
> and effdate < sysdate-1;
>
> Thanks!
>
>
![]() |
![]() |