Query only returns rows from one specific day instead of yesterday
Hi!
I have this query:
select store_day_seq_no, business_date, store, day, inv_bus_date_ind, inv_store_ind, store_status, data_status, audit_status
from sa_store_day
where to_char(business_date,'yyyymmdd') = to_char(sysdate +(1-to_char(sysdate,'D')),'yyyymmdd')
and data_status = 'R';
The output is used to create a report.
The strange thing is that I ran the query today and yesterday. I got the same output. There must be something wrong with the where clause.
If I run the query today it should return "rows" from yesterday.
How do I fix this?
I have this query:
select store_day_seq_no, business_date, store, day, inv_bus_date_ind, inv_store_ind, store_status, data_status, audit_status
from sa_store_day
where to_char(business_date,'yyyymmdd') = to_char(sysdate +(1-to_char(sysdate,'D')),'yyyymmdd')
and data_status = 'R';
The output is used to create a report.
The strange thing is that I ran the query today and yesterday. I got the same output. There must be something wrong with the where clause.
If I run the query today it should return "rows" from yesterday.
How do I fix this?
0