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!

Runtime in Batch vs Online

Status
Not open for further replies.

kskid

Technical User
Mar 21, 2003
1,767
US
CR 8.5, Oracle 8i

I have the following formula in the report footer. I use currentdatetime since I am creating a pdf file with no printer specified.

WhilePrintingRecords;
NumberVar TotalSec := datediff("s", Datetime(DataDate,DataTime),CurrentDateTime);
NumberVar Days := Truncate (TotalSec / 86400);
NumberVar Hours := Truncate (Remainder ( TotalSec,86400) / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
NumberVar Seconds := Remainder ( TotalSec , 60);
"Total Run Time = " +
Totext ( Days, '00', 0,'') + ' '+
Totext ( Hours, '00', 0,'') + ':'+
Totext ( Minutes,'00', 0,'') + ':'+
Totext ( Seconds,'00', 0,'')

When I run this report online, it works fine but is coming up with zero or negative numbers when it runs in a batch program that was written in VB6.

Does VB handle CurrentDate differently.

Any ideas?
 
It may be that datadate is the same depending upon how the data is extracted.

To check for differences in datadate and currentdate and printdate, place all 3 in the footer and test.

-k
 
I placed currentdate, data date, data time, print date and print time in both the Report Header and Report Footer

Report Header

Batch
CurrentdateTime 07/27/2004 01:02:22
Data Date & Time 07/27/2004 01:04:00
Print Date & Time 07/27/2004 01:04:00

Report Footer

Batch
CurrentdateTime 07/27/2004 01:02:22
Data Date & Time 07/27/2004 01:04:00
Print Date & Time 07/27/2004 01:04:00

Results: No change in current and print dates and times in Report Header and Report Footer

Report Header

On-Line
CurrentdateTime 07/27/2004 10:38:40
Data Date & Time 07/27/2004 10:38:40
Print Date & Time 07/27/2004 10:38:40

Report Footer

On-Line
CurrentdateTime 07/27/2004 10:40:29
Data Date & Time 07/27/2004 10:38:40
Print Date & Time 07/27/2004 10:40:29

Results

The Current and Print Dates/Times increments between Report Header and Report Footer.

Does this means that VB 6 just grabs the initial dates and times?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top