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!

Executing code after IF statement

Status
Not open for further replies.

grubgal

IS-IT--Management
Jan 19, 2005
15
US
OK. I'm a slight noob to the reporting thing. I keep getting an error in my formula with anything I put after my IF statement. Here is my code:

numberVar AvgTime;
numberVar RemainingSeconds;
numberVar Days;
numberVar Hours;
numberVar Minutes;
numberVar Seconds;
numberVar tempTime;

AvgTime := ((Sum ({@WorkHoursFormula}, {TASKS.TYPE})) / (Count ({@DisplayTime}, {TASKS.TYPE})));

if (AvgTime >= 8) then
// Dividing WorkHours by 8 hours in a work day
(Days := truncate(AvgTime / 8);

//Get the remainder from the days
tempTime := (AvgTime / 8) - Days;

//Conver to seconds by multiplying by # seconds in work day
RemainingSeconds := tempTime * 28800;)
else
(RemainingSeconds := AvgTime * 3600;)


---ERROR HIGHLIGHT STARTS---
RemainingSeconds := (RemainingSeconds - (Hours * 3600));

Minutes := truncate(RemainingSeconds / 60);

Seconds := truncate(RemainingSeconds - (Minutes * 60));

totext(Days,"00")+":" + totext(Hours,"00") + ":" + totext(Minutes,"00") + ":" + totext(Seconds,"00")
------------------------------------------------------

OK. so I get the error that highlights everything after the end of my else statement that says "The remaining text does not appear to be part of the formula".

Please help :)
 
Try adding a semicolon after you close the parentheses for the Else statement:

else
(RemainingSeconds := AvgTime * 3600;)[red];[/red]

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top