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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula help

Status
Not open for further replies.

BlurredVision

Technical User
Aug 6, 2001
326
GB
Hello All..

Looking for a little help.

I have the following information

Jobname Date/Time
TR350 01/19/2004 00:23
TR350 01/20/2004 01:00
CYCLE 01/19/2004 02:00
CYCLE 01/20/2004 02:15
CYCLE 01/21/2004 02:05
CYCLE 01/22/2004 02:00


I need to find the Maximum datetime of the jobname TR350, then I need to pull the first datetime of CYCLE that follows TR350. In the example above, I need to pull the following

TR350 = 1/20/2004 01:00
CYCLE = 1/20/2004 02:15

Thanks for any help given.
 
How is the formula getting the jobname info? What are the field names?

Thanks,
Thadeus
 
Job names are just fields with in the database.


Fields names are Jobname and entrydatetime
 
I think you could do this by creating three formulas:

//{@TR350}:
if {table.jobname} = "TR350" then {table.entrydatetime}

//{@cycle}:
whileprintingrecords;
datetimevar cycle;
numbervar counter;

if {table.jobname} = "Cycle" and
{table.entrydatetime} > maximum({@TR350}, {table.groupfield}) then
(counter := counter + 1;
if counter = 1 then cycle := {table.entrydatetime} else cycle := datetime(0,0,0,0,0,0));
cycle;

Then go to the section expert (format->section) and select the details section->suppress->x+2 and enter:

datetimevar cycle;

({table.jobname} = "TR350" and
{@TR350} <> maximum({@TR350},{table.groupfield})) or
({table.jobname} = "Cycle" and
cycle = datetime(0,0,0,0,0,0))

-LB
 
I have to ask these questions...that noone has asked...

Are there only 2 jobnames in your report?
Other than this requirement....how is the report laid out?
Are the groupings by Jobnames??



Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top