Date Calculation - WW

Eric

Active Member
From: "LOKE" <[email protected]>
To: "World" <[email protected]>
Subject: Date Calculation - WW
Date: Thu, 15 Feb 2001 10:23:01 +0800

Hi Lists,
Help!! How can I calculate the no of days variance
within 2 date in world
writer report. OK, if the date within the same year,
it's not a issue. When
these date come from two different year, it will
calculate different results
e.g. :
Same Year
Actual Result : 01/01/01 - 05/01/01 = 4
Julian Format : 101001 - 101005 = 4

Different year
Actual Result : 31/1/00- 05/01/01 = 5
Julian Format : 100365 - 101005 = 640

Thanks in advance for any information.


----- End forwarded message -----
 
If you want to subtract days create a calculated field and take out the edit code in WW on the Output Field Specifications screen. Example: f01.sdaddj - f01.sddrqj would be the calculation, and the Edit Code will be blank. Works great!
 
--0__=OSzu9wvrklTe6QQJJdKipgP2wcjaxPiCjp7PMuXgBiZuqthVGrYOS65g
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline



Eric,
Create a RPG pgm using X0035, you can use X0035 also in CL pgm.
Emad




Eric <[email protected]> on 02/15/2001 02:54:01 PM

Please respond to [email protected]

To: [email protected]
cc: (bcc: Emad S Banoub/User/Americas/Montgomery Watson)

Subject: Date Calculation - WW



From: "LOKE" <[email protected]>
To: "World" <[email protected]>
Subject: Date Calculation - WW
Date: Thu, 15 Feb 2001 10:23:01 +0800

Hi Lists,
Help!! How can I calculate the no of days variance
within 2 date in world
writer report. OK, if the date within the same year,
it's not a issue. When
these date come from two different year, it will
calculate different results
e.g. :
Same Year
Actual Result : 01/01/01 - 05/01/01 = 4
Julian Format : 101001 - 101005 = 4

Different year
Actual Result : 31/1/00- 05/01/01 = 5
Julian Format : 100365 - 101005 = 640

Thanks in advance for any information.


----- End forwarded message -----




--------------------------
To view this thread, visit the JDEList forum at:
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Ca
t=0&Board=W&Number=5709

----- End forwarded message -----




--------------------------
To view this thread, visit the JDEList forum at:
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Cat=0&Board=W&Number=5711
*************************************************************
This is the JDEList World Mailing List.
Archives and information on how to SUBSCRIBE, and
UNSUBSCRIBE can be found at http://www.JDELIST.com
*************************************************************


--0__=OSzu9wvrklTe6QQJJdKipgP2wcjaxPiCjp7PMuXgBiZuqthVGrYOS65g
Content-type: application/octet-stream;
name="att1.eml"
Content-Disposition: attachment; filename="att1.eml"
Content-transfer-encoding: base64

UmVjZWl2ZWQ6IGZyb20gamRlbGlzdC5jb20gKFsyMTYuMTIyLjEyLjEwNV0pIGJ5IG13LmNvbSAo
TG90dXMgU01UUCBNVEEgdjQuNi4zICAoNzMzLjIgMTAtMTYtMTk5OCkpIHdpdGggU01UUCBpZCA4
ODI1NjlGNC4wMDdGRjNBMDsgVGh1LCAxNSBGZWIgMjAwMSAxNToxNzozNCAtMDgwMA0KUmVjZWl2
ZWQ6IGJ5IGpkZWxpc3QuY29tICg4LjkuMy84LjkuMykgaWQgT0FBMjIxOTkNCglmb3IgamRld29y
bGRtbC02MjYzMTIyNTsgVGh1LCAxNSBGZWIgMjAwMSAxNDo1NDowNSAtMDgwMCAoUFNUKQ0KUmVj
ZWl2ZWQ6IGZyb20gc2hlbGwudHNvZnQuY29tIChlcmljQHNoZWxsLnRzb2Z0LmNvbSBbMTk4LjE0
NC4xOTIuNV0pDQoJYnkgamRlbGlzdC5jb20gKDguOS4zLzguOS4zKSB3aXRoIEVTTVRQIGlkIE9B
QTIyMTgzDQoJZm9yIDxqZGV3b3JsZG1sQGpkZWxpc3QuY29tPjsgVGh1LCAxNSBGZWIgMjAwMSAx
NDo1NDowMiAtMDgwMCAoUFNUKQ0KUmVjZWl2ZWQ6IChmcm9tIGVyaWNAbG9jYWxob3N0KQ0KCWJ5
IHNoZWxsLnRzb2Z0LmNvbSAoOC44LjcvOC44LjcpIGlkIE9BQTI5NzA4Ow0KCVRodSwgMTUgRmVi
IDIwMDEgMTQ6NTQ6MDEgLTA4MDAgKFBTVCkNCkRhdGU6IFRodSwgMTUgRmViIDIwMDEgMTQ6NTQ6
MDEgL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uY29tDQoqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQoNCg==

--0__=OSzu9wvrklTe6QQJJdKipgP2wcjaxPiCjp7PMuXgBiZuqthVGrYOS65g--
 
SDufee,
Thankz for your information. I did tried before, if both date are within a
year, everything works great ,but did you noticed that when you come across
01-Jan-01 subtract 25-Dec-00, system will calculate as 101001 - 100360 =
641.



----- Original Message -----
From: "SDurfee" <[email protected]>
To: <[email protected]>
Sent: Friday, February 16, 2001 06:17 AM
Subject: Re: Date Calculation - WW


> If you want to subtract days create a calculated field and take out the
edit code in WW on the Output Field Specifications screen. Example:
f01.sdaddj - f01.sddrqj would be the calculation, and the Edit Code will be
blank. Works great!
>
>
> --------------------------
> Visit the forum to view this thread at:
>
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Cat=&Board=W&Number=57
10
> *************************************************************
> This is the JDEList World Mailing List.
> Archives and information on how to SUBSCRIBE, and
> UNSUBSCRIBE can be found at http://www.JDELIST.com
> *************************************************************
>
 
Here's what you have to do


Y1 y1 8 0 8 0 *DF N N N
INTEGER(prrcdj / 1000)
D1 d1 8 0 8 0 *DF N N N
prrcdj - Y1 * 1000
Y2 y2 8 0 8 0 *DF N N N
INTEGER(prpddj / 1000)
D2 d2 8 0 8 0 *DF N N N
prpddj - Y2 * 1000
DAYSLATE dayslate 4 0 4 0 *DF N A N
Y1 * 365 + D1 - Y2 * 365 - D2
This will allow you to find days difference when crossing years. Debbie




yhl <[email protected]> on 02/15/2001 07:25:45 PM

Please respond to [email protected]

To: [email protected]
cc: (bcc: Debbie Kazinski/FLECKHQ/PENTAIR/US)

Subject: Re: Date Calculation - WW



SDufee,
Thankz for your information. I did tried before, if both date are within a
year, everything works great ,but did you noticed that when you come across
01-Jan-01 subtract 25-Dec-00, system will calculate as 101001 - 100360 =
641.



----- Original Message -----
From: "SDurfee" <[email protected]>
To: <[email protected]>
Sent: Friday, February 16, 2001 06:17 AM
Subject: Re: Date Calculation - WW


> If you want to subtract days create a calculated field and take out the
edit code in WW on the Output Field Specifications screen. Example:
f01.sdaddj - f01.sddrqj would be the calculation, and the Edit Code will be
blank. Works great!
>
>
> --------------------------
> Visit the forum to view this thread at:
>
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Cat=&Board=W&Number=57
10
> *************************************************************
> This is the JDEList World Mailing List.
> Archives and information on how to SUBSCRIBE, and
> UNSUBSCRIBE can be found at http://www.JDELIST.com
> *************************************************************
>






--------------------------
To view this thread, visit the JDEList forum at:
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Cat=0&Board=W&Number=5720
*************************************************************
This is the JDEList World Mailing List.
Archives and information on how to SUBSCRIBE, and
UNSUBSCRIBE can be found at http://www.JDELIST.com
*************************************************************
 
How to calculate in WW across years.

Field
PDPDDJ Scheduled Pick . . . . 8 0

Y1 year pick 8 0
integer(pdpddj/1000)

D1 day pick 8 0
pdpddj - y1 * 1000

PDADDJ Actual Ship. . . . . . 8 0

Y2 year ship 8 0
integer(pdaddj / 1000)

D2 day ship 8 0
pdaddj - y2 * 1000

DIFF difference new 4 0
y2 * 365 + d2 - y1 * 365 -d1

I wanted it displayed as a positive number which is why I changed it to subtract date1 from date2


Scott Parker
Grote Industries, LLC.
WorldSoftware Version 8.1.2 AS/400 V4R5
 
Back
Top