View previous topic :: View next topic
|
Author |
Message |
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi All,
I have to find the month difference between the start date and stop date(for example). How can I do that? Is there any function to use that in COBOL? Elaborately :-
For example, I am having start date as 10/27/06 and end date as 08/31/08. Now I want to find the month difference between these two date? Is there any function in COBOL to find out the month difference? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi Guptae,
Thanx for your help. Actually I wanted to know if there is any in-built function or so to calcualte the month difference between two dates provided. However we have done that by using the following DB2 call like -
Code: |
SELECT
(YEAR(CURRENT_DATE) - YEAR('2000-12-20')) * 12 +
MONTH(CURRENT_DATE) - MONTH('2000-12-20')
FROM SYSIBM.SYSDUMMY1
;
|
I think this will help you all if you faced the situation like me. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Amitava,
If u want it through then why u posted this question on COBOL forum? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Amitava,
If u want it through db2 then why u posted this question on COBOL forum? |
|
Back to top |
|
|
|