I need six weeks of data in my report, including the current week(finished or not). So, if today is Friday and week_id 27, I need to pull in week_id's 22 through 27.
In my time table, I have:
week_id, dt
In my fact table, I have:
dt, sales
How can I pull six weeks of data based on the current date?
i.e.
select * from sales s, time t
where s.dt = t.dt
and week_id >= select (week_id - 5) from time where dt = trunc(sysdate)
Thanks for any help! This sub-query type of stuff is giving me a hard time.
Stacy
In my time table, I have:
week_id, dt
In my fact table, I have:
dt, sales
How can I pull six weeks of data based on the current date?
i.e.
select * from sales s, time t
where s.dt = t.dt
and week_id >= select (week_id - 5) from time where dt = trunc(sysdate)
Thanks for any help! This sub-query type of stuff is giving me a hard time.
Stacy