-
the original poster requirement is:
post date/time before midday then date ||'00:00:01'
after midday date+1 || '00:00:01'
I interpret this as meaning if the sysdate & time is > 12:00 PM then set the OHPOSTDATE := SYSDATE +1 || ’00:01” AM)
-- ie. The next day at 12:00:01 AM.
else
set the OHPOSTDATE := SYSDATE || ’00:01” AM)
-
Or ultimately better for performance is to skip the completely unnecessary SELECT and simply assign a date-type variable the value ROUND(sysdate)+1/(24*60). Why drag down your database with a select when it's not even needed ?!