Kyle H
Kyle H

Reputation: 3303

Set date = tomorrow at a static time in Oracle PLSQL?

So I need to set a DATE variable equal to tomorrow's date and I need to set the time to 12:00AM (static). I have the following code that works, but I think there's a cleaner way that I'm missing.


end_date:= to_date((EXTRACT(MONTH FROM sysdate+1))||'/'||
                   (EXTRACT(DAY FROM sysdate+1))||'/'||
                   (EXTRACT(YEAR FROM sysdate+1))||
                   ' 12:00 AM', 'MM/DD/YYYY HH:MI PM');

So that gets the job done, but is there an easier way for me to set the end_date variable?

Thank you

Upvotes: 3

Views: 8896

Answers (1)

user359040
user359040

Reputation:

How about:

end_date:=trunc(sysdate+1);

?

Upvotes: 14

Related Questions