Nearest midnight: won't TRUNC(sysdate + 0.5)+1/(24*60) do that?