oracle SQL how to remove time from date

前端 未结 5 680
小鲜肉
小鲜肉 2020-12-03 02:48

I have a column named StartDate containing a date in this format: 03-03-2012 15:22

What I need is to convert it to date. It should be looki

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 03:08

    You can use TRUNC on DateTime to remove Time part of the DateTime. So your where clause can be:

    AND TRUNC(p1.PA_VALUE) >= TO_DATE('25/10/2012', 'DD/MM/YYYY')
    

    The TRUNCATE (datetime) function returns date with the time portion of the day truncated to the unit specified by the format model.

提交回复
热议问题