Hello
I am sure this is well within most peoples capability on this site and am a little embarassed posting this but alas here goes.

I am using Crystal reports and I have only just remembered I can use VB code in Crystal.
I have a report based on 3 tables from the db. Project, ProjPhase and ProjectTask, this is the hierarchy too.
Certain tasks completed in turn complete the phase.

I need to display the next phase (description) of the project on a report.
The fields I'm using in this report are

projphase.phaseid = 1 - 18 (although stored as a string)
projphase.description = description of phaseid above 1-18. This ultimately is the field I need to display
projphase.phasestatus = C I or N (Complete, Incomplete or Not Started)
projphase.percentcomplete = 0 or 100 (number)
projphase.datecomplete = date

projecttask.taskid = (String) this field is relevant but not linked to the projphase.phaseid field where 1.1 – 1.6 constitute Phase 1 where the most tasks to a phase are 21. i.e. 7.21
projecttask.percentcomplete = 0,50,80,90,100 (number)
projecttask.taskstatus = C I or N (Complete, Incomplete or Not Started)
projecttask.datecomplete = date

I would include some code but I have been working on it all day and it’s a dogs breakfast…

The logic is that I need to display the next projphase.description (projphase.phasestatus = I or N) where the previous is complete but may have projphase.percentcomplete = 0 although will have a projphase.phasestatus = C
I keep striking problems as if the next projphase.phasestatus = N then so too do all of the following.
Perhaps I should just be using the datecomplete fields although can’t get the description + 1.
Please help this poor dumb ass?
Thanks

Here is Crystal Syntax. This generates nothing or 1st phase desc only.
//local stringvar array x:= {projphase.phasestatus};
//local stringvar array y:= {projphase.description}
//
//if x = "C"
//then next (y)

if next ({projphase.phasestatus}) <> "C" and next ({projecttask.taskstatus}) <> "C" and next ({projecttask.percentcomplete}) <> 100
then next ({projphase.description})


This is my basic syntax, which generated record 17 of 18 or the text.
if nextvalue ({projphase.phasestatus}) <> "C" then
Formula =({projphase.description})
else
formula = "this is really shitting me!!!"
end if

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.