Link to home
Start Free TrialLog in
Avatar of Weller0123
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!
Avatar of waynezhu
waynezhu

Are you looking for crosstab query?
If yes, check it out (also AskTom)
http://thinkoracle.blogspot.com/2005/09/pivot-and-crosstab-queries.html
Avatar of Weller0123

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

SOLUTION
Avatar of waynezhu
waynezhu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial