Oracle query all records for today, yesterday, this week, this month and this quarter
- Field type is date
Today
select * from table name where to_char(field name,'dd')=to_char(sysdate,'dd')
yesterday
select * from table namewhere to_char(field name,'dd')= to_char(sysdate-1,'dd')
this week
select * from table namewhere to_char(field name,'iw')=to_char(sysdate,'iw ')
this month
select * from table name where to_char(field name, 'mm')=to_char(sysdate, 'mm')
this quarter
select * from table name where to_char(field name, 'q')=to_char(sysdate, 'q')