Oracle current_date or sysdate without hours, minutes, seconds

Is there a way to get rid of the time of day when using current_date or sysdate . I try to only save the date as YYYY-MM-DD , but current_date gives me YYYY-MM-DD HH:MM:SS:MS

Or when comparing dates, it only compares the date, and not the time will be just as good. Any help would be awesome, thanks.

+7
source share
2 answers

Maybe you should try

 trunc(sysdate) 

function.

+20
source
Rusty answered part of your question about canceling the time part. The part about including time when comparing dates is often done as follows.
 where YourDateField >= StartDate and YourDateField < TheDayAfterEndDate 

If you want to search on a specific date, StartDate and EndDate will be the same.

+1
source

All Articles