Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Coincidence between two range dates

Former Member
0 Likes
507

Hello.

Is there any FM return the days that coincidence two ranges of dates?

Example:

Date1 ='20080101 'to'20080115'.

Date2 ='20080110 'to'20080120'.

The result would be: 5 days.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
478

u can do it like this way:

result = ( Day2 - Day1 ).

= { ( 20080115 - 20080101 ) - ( 20080120 - 20080110 ) } .

As the date is sydatum format u can substraction between two dates.

3 REPLIES 3
Read only

Former Member
0 Likes
479

u can do it like this way:

result = ( Day2 - Day1 ).

= { ( 20080115 - 20080101 ) - ( 20080120 - 20080110 ) } .

As the date is sydatum format u can substraction between two dates.

Read only

Former Member
0 Likes
478

Hi,

take


days = date1-high - date2-low.

rgds,

bharat.

Read only

Former Member
0 Likes
478

Hi,

DO the following modification:

For eg.

dates: 20080101 -- 20080103.

and 20080102 -- 20080104.

take one internal table

and append records as follows.

itab:

20080101

20080102

20080103

20080102

20080103

20080104

Use describe lines to find no of records.

Here 6 i our case.

sort it and apply delete adjacent duplicates.

check no of record using describe lines.

Here it wud be 4.

Difference will give you the common days.

6-4 = 2.

Regards,

Nishant