Application Development 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: 

finding the latest date between the two given dates

Former Member
0 Kudos

hi,

iam having the two dates,i have to find the latest of the two dates.how can i go through it.

it is very urgent.

thanks in advance

4 REPLIES 4

Former Member
0 Kudos

Hi Surya,

if first_date > secound_date.

write : 'first_date is greater'.

else.

write : 'second_date is greater'.

endif.

REward if useful

gopal_jee
Explorer
0 Kudos

Hi Surya,

If you have two dates then you can simply compare two dates by using relational operator like GT, LT etc and you can find out the latest date.

Kindly reward points if it is useful.

Regards,

Gopal.

Former Member
0 Kudos

just check surya..

data: x type i ..

x = d2 - d1.

if x > 0.

write: 'first date is bigger'.

elseif x < 0.

write ' second date is bigger'.

else.

write: ' both are equal'.

endif.

rewards points if usef ull

Former Member
0 Kudos

Hi,

DATA:dat1 TYPE sy-datum,

dat2 TYPE sy-datum.

DAT1 = SY-DATUM.

DAT2 = DAT1 - 10.

IF dat2 > dat1.

write:/ 'DAT2 is earlier'.

else.

WRITE:/ 'DAT1 is earlier'.

ENDIF.

rgds,

bharat.