Please can someone help me to build a reportquery or an universe object for getting the following results.
My data is about this:
Projectid / Activitycode / Act.DS Earlystart / ActualStart
P001 / 110M / blabla / 1-1-08 / 1-1-08
P001 / 230M / fdsfds / 31-1-09 / null
P001 / 450M / fsfsd / 1-4-09 / null
P002 / null / null / 1-12-08 / 1-12-08
P002 / 110M / nhggh / 5-2-09 / null
P002 / 750M / wdwdwd / 5-2-09 / null
P002 / 210M / plplplp / 31-12-08 / 31-12-08
P002 / 550M / ewdwd / 5-1-09 / null
I’d like to get one row for each Projectid with the first next Early- or Actualstart after today and one row with the latest early-/actualstart before today. When there are two or mare rows with the same date then I want the highest Activitycode. This last condition makes it insoluble for me!
I’ve tryed free SQL, with nested Select-statements, but I got still 2 rows per projectid, because I select the min(nvl(Earlystart ,ActualStart ) but the !!! I’ve tryed object in the universe with Partion BY, but the same problem.
Can someone show me the right way to solve my problem?
Wittk (BOB member since 2009-01-23)