Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Caculation problem for a value over 1 day time record

3 posts in PB Infomaker Report Writer Last posting was on 1998-07-06 18:53:37.0Z
C.K.Ho Posted on 1998-06-23 07:43:31.0Z
Newsgroups: sybase.public.infomaker.general
From: "C.K.Ho" <chenkhee@Bigfoot.com>
Subject: Caculation problem for a value over 1 day time record
Date: Tue, 23 Jun 1998 15:43:31 +0800
Lines: 41
Organization: DECOM SYSTEM SDN BHD
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Message-ID: <348_3QcHGFnn9GA.202@forums.powersoft.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7038
Article PK: 243068

Thanks for your help previously. I have another tough question for you this
time, hope you have an answer for it. I'm try to present a report for
downtime of the machine, the problem is whenever the machine breakdown over
or more than one day I'm not able calculate the downtime correctly.

For example, a Vehicle1 breakdown from 22:00 22/06/1998 to 2:00 23/06/1998.
As logically we know the total downtime for 22/06/1998 are 2 hours and for
23/06/1998 are 2 hours. So, it look fair and simple isn't it, but how to do
it? I'm not able to store the computed value in a variable where sum for
next record. As we know, the value in variable will refresh whenever next
record is read. The more details and picture of my question is shown as
below.


*Sample table and data

assetno out_date out_time rts_date rts_time
downtime
Vehicle01 18/06/1998 800 18/06/1998 1000 2
Vehicle01 18/06/1998 1100 18/06/1998 1500 4
Vehicle01 18/06/1998 2200 19/06/1998 200 4
Vehicle01 19/06/1998 2000 20/06/1998 300 7


*Expected result (How to achieve this result)

Asset No Out Of Service Total Downtime
Vehicle01 18/06/1998 8
Vehicle01 19/06/1998 6
Vehicle01 20/06/1998 3




Thank you.


Regards, C.K.Ho


Terry Dykstra [TeamPS] Posted on 1998-07-06 18:53:37.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra [TeamPS]" <no_spam_tdykstra@cfol.ab.ca>
Subject: Re: Caculation problem for a value over 1 day time record
Date: Mon, 6 Jul 1998 12:53:37 -0600
Lines: 51
Organization: Canadian Forest Oil Ltd.
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Message-ID: <348_aaUt$WQq9GA.124@forums.powersoft.com>
References: <348_3QcHGFnn9GA.202@forums.powersoft.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7025
Article PK: 243054

I've thought this one over for quite some time now, and I think you'll have
to use a stored procedure to calculate the desired results.

--
Terry Dykstra [TeamPS]
Canadian Forest Oil Ltd.

C.K.Ho wrote in message <3QcHGFnn9GA.202@forums.powersoft.com>...
>Thanks for your help previously. I have another tough question for you this
>time, hope you have an answer for it. I'm try to present a report for
>downtime of the machine, the problem is whenever the machine breakdown over
>or more than one day I'm not able calculate the downtime correctly.
>
>For example, a Vehicle1 breakdown from 22:00 22/06/1998 to 2:00
23/06/1998.
>As logically we know the total downtime for 22/06/1998 are 2 hours and for
>23/06/1998 are 2 hours. So, it look fair and simple isn't it, but how to do
>it? I'm not able to store the computed value in a variable where sum for
>next record. As we know, the value in variable will refresh whenever next
>record is read. The more details and picture of my question is shown as
>below.
>
>
>*Sample table and data
>
>assetno out_date out_time rts_date rts_time
>downtime
>Vehicle01 18/06/1998 800 18/06/1998 1000 2
>Vehicle01 18/06/1998 1100 18/06/1998 1500 4
>Vehicle01 18/06/1998 2200 19/06/1998 200 4
>Vehicle01 19/06/1998 2000 20/06/1998 300 7
>
>
>*Expected result (How to achieve this result)
>
>Asset No Out Of Service Total Downtime
>Vehicle01 18/06/1998 8
>Vehicle01 19/06/1998 6
>Vehicle01 20/06/1998 3
>
>
>
>
>Thank you.
>
>
>Regards, C.K.Ho
>
>
>


Jody LaPosta Posted on 1998-06-23 13:22:42.0Z
Newsgroups: sybase.public.infomaker.general
Date: Tue, 23 Jun 1998 09:22:42 -0400
From: Jody LaPosta <jlaposta@sybase.com>
Organization: PowerBuilder Technical Support
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
Subject: Re: Caculation problem for a value over 1 day time record
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 42
Message-ID: <348_358FAC21.DB837BCA@sybase.com>
References: <348_3QcHGFnn9GA.202@forums.powersoft.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7037
Article PK: 243067

Hi C.K.,
You could use the SecondsAfter function and then divide the result by 3600
to get hours.

HTH,
Jody LaPosta

C.K.Ho wrote:

> Thanks for your help previously. I have another tough question for you this
> time, hope you have an answer for it. I'm try to present a report for
> downtime of the machine, the problem is whenever the machine breakdown over
> or more than one day I'm not able calculate the downtime correctly.
>
> For example, a Vehicle1 breakdown from 22:00 22/06/1998 to 2:00 23/06/1998.
> As logically we know the total downtime for 22/06/1998 are 2 hours and for
> 23/06/1998 are 2 hours. So, it look fair and simple isn't it, but how to do
> it? I'm not able to store the computed value in a variable where sum for
> next record. As we know, the value in variable will refresh whenever next
> record is read. The more details and picture of my question is shown as
> below.
>
> *Sample table and data
>
> assetno out_date out_time rts_date rts_time
> downtime
> Vehicle01 18/06/1998 800 18/06/1998 1000 2
> Vehicle01 18/06/1998 1100 18/06/1998 1500 4
> Vehicle01 18/06/1998 2200 19/06/1998 200 4
> Vehicle01 19/06/1998 2000 20/06/1998 300 7
>
> *Expected result (How to achieve this result)
>
> Asset No Out Of Service Total Downtime
> Vehicle01 18/06/1998 8
> Vehicle01 19/06/1998 6
> Vehicle01 20/06/1998 3
>
> Thank you.
>
> Regards, C.K.Ho