Thursday, July 22, 2021

SQL - Display the records created using trunc(sysdate)

Display the records that are created today

select count(*) from TASKS where trunc(created_date)=trunc(sysdate)

We need to use trunc as date is stored as date and time.

Trunc strips off the time and returns only date.

No comments:

Post a Comment

Please add value. Sharing is caring