Weller0123
asked on
Pulling data for current week Sat - Friday:
What would be the best way to show weely timesheet data? Each ETNumber already has a built in timeslice. So it's like b.date for that project.
I just need to show the data for the current week back through Saturday. I'sn't there something built into the date fctn?
Date Sat Sun Mon Tue Wed Thu Fri
ET Number b.date b.date b.date b.date b.date b.date b.date
ET Number b.date b.date b.date b.date b.date b.date b.date
I don't understand how you would get 7 different days in a single row. The "b.date(-7)" part is where I don't get it.
Would it be something like?...
Select
ET_NUMBER,
b.date(-7)
b.date(-6)
b.date(-5)
b.date(-4)
b.date(-3)
b.date(-2)
b.date(-1)
from
xxx
Where
xxx
The first two days would actually come from the last week.
So I need last week's Sat and Sunday.
Then Monday thru Friday.
Thanks in Advance!
I just need to show the data for the current week back through Saturday. I'sn't there something built into the date fctn?
Date Sat Sun Mon Tue Wed Thu Fri
ET Number b.date b.date b.date b.date b.date b.date b.date
ET Number b.date b.date b.date b.date b.date b.date b.date
I don't understand how you would get 7 different days in a single row. The "b.date(-7)" part is where I don't get it.
Would it be something like?...
Select
ET_NUMBER,
b.date(-7)
b.date(-6)
b.date(-5)
b.date(-4)
b.date(-3)
b.date(-2)
b.date(-1)
from
xxx
Where
xxx
The first two days would actually come from the last week.
So I need last week's Sat and Sunday.
Then Monday thru Friday.
Thanks in Advance!
ASKER
Simplified question with SQL:
I don't think I'm going to need a crosstab. I'll be using a portlet that will do some of that.
I just need to adress the current week; Saturday - Friday using the IW function.
Even if I call each value, that's fine. It's still only 7 columns. I only need the current week.
Somehow I need to compare the current week with "to_char((b.slice_date +2),'IW')" So I only show the current week.
Something like this:
to_char((b.slice_date - 2),'IW') = to_char(sysdate,'IW') and
I don't think I'm going to need a crosstab. I'll be using a portlet that will do some of that.
I just need to adress the current week; Saturday - Friday using the IW function.
Even if I call each value, that's fine. It's still only 7 columns. I only need the current week.
Somehow I need to compare the current week with "to_char((b.slice_date +2),'IW')" So I only show the current week.
Something like this:
to_char((b.slice_date - 2),'IW') = to_char(sysdate,'IW') and
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If yes, check it out (also AskTom)
http://thinkoracle.blogspot.com/2005/09/pivot-and-crosstab-queries.html