Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Variables using DateTime Value

Status
Not open for further replies.

szeiss

Programmer
Apr 5, 2000
137
US
Using CR 8.0 and Oracle database. I've used shared variables in the past but only with numbers and I'm not real handy when it comes to dates. Here is my problem. In my subreport I have these 3 groups in the following order: Employee_ID, Project_Name, Phase. In the "Phase" groupfooter 3 I have the following formula:

WhilePrintingRecords;
Shared DateTimeVar MnBm :=
Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE})

I am looking for the earliest date in a particular phase.

In the Main report, I think I need to do the Initialize, Evaluate, Display process. I have the same groups in the main report as the subreport and in the same order. So in "Phase" groupheader 3a I have the following formula:

//InitMnBM
WhilePrintingRecords;
DateTimeVar MnBm;
MnBm := Date(0,0,0);

In the groupheader 3b I have the following formula:

//EvalMnBm
WhilePrintingRecords;
DateTimeVar MnBm;
MnBm := MnBm

In the groupfooter 3 I have the following formula:

//DispMnBm
WhilePrintingRecords;
DateTimeVar MnBm;
MnBm;

Before I went to the 3 step process I was just using the following formula in the groupfooter 3, but it wasn't resetting between the projects:

//MainMnBM
WhilePrintingRecords;
Shared DateTimeVar MnBm;
MnBm

With the 3 step process I'm not getting any date values and with the //MainMnBM it's not resetting. Can anyone help?

Thanks,
Sherry
 
Hi Sherry,
If you want the earliest date for a phase, just put this in a formula in the phase group:
Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE}, {WhateverYourGroup3FieldIs})
If you want the earliest date for a project, just put this in a formula in the project group:
Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE}, {WhateverYourGroup2FieldIs})

Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
I tried the following formula in the subreport:

WhilePrintingRecords;
Shared DateTimeVar MnBm :=
Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE}, {LIST_SUBPROJECT_EVENTS.PHASE})

I'm assuming you mean't in the subreport, but I still have the problem of not resetting.

Sherry
 
Sorry, I wasn't sure whether you were using a subreport, so I offered the simpler solution (which won't work in your case).
Put this formula in your subreport:
Shared DateTimeVar MnBm := Date(0,0,0) ;
MnBm := Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE})
Your subreport object must be in your phase group.
Put this formula in your main report to display the result, in the phase group, in a section that follows the subreport object.
Shared DateTimeVar MnBm
Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Ok, I put the following in my subreport in the phase groupfooter 3:

WhilePrintingRecords;
Shared DateTimeVar MnBm := Date(0,0,0) ;
MnBm := Minimum({SUBPROJECT_BENCHMARKS.BENCHMARK_DATE})

In the main report, I have the subreport in the Phase groupfooter 3a and the following formula in the Phase groupfooter 3b:

WhilePrintingRecords;
Shared DateTimeVar MnBm

Now, I don't have a groupfooter 3a & b in the subreport but I don't think that would be a problem. But, anyway I don't get any values in the main report.

Sherry
 
I think it's working now! Hold on.

Sherry
 
It's working, thanks a bunch for your help.

Sherry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top