View previous topic :: View next topic
|
Author |
Message |
pecram24
New User
Joined: 12 Oct 2009 Posts: 35 Location: Chennai
|
|
|
|
Hi,
Can anyone help me in this..
I need to compare two dates and the result will be the difference between the two dates.
for example..
WS-DUE-DATE W 10 A
WS-CAN-DATE W 10 A
WS-DATE-DIFF W 4 N VALUE 0
WS-DUE-DATE 20120120
WS-CAN-DATE 20120101
if we compare the above dates the difference should be in WS-DATE-DIFF.
WS-DATE-DIFF = 19
Thanks in advance. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you "compare" two dates, you don't get access to the difference, your code just respects the path which results from the compare being true/false.
If you want to get a difference between dates, you'll have to subtract them, and to do that you'll need to convert them to days, or use some program to do it. |
|
Back to top |
|
|
pecram24
New User
Joined: 12 Oct 2009 Posts: 35 Location: Chennai
|
|
|
|
thank u.. but how we can convert the date in such a format in easytrieve. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The usual way :-)
Do you have some date routine which is used by Cobol progams? If not, see if LE has something. Else you have to code it yourself, and may as well make it a sub-routine which can be used generally. |
|
Back to top |
|
|
|