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

sql query

Former Member
0 Likes
493

Hi ,

Can anybody tell me how to pick the latest date.

I am using a sql query

Select * into table itab from mseg as A inner join mkpf as B where Amblnr = Bmblnr where budat = max ( budat).

endselect.

regards

Mave

4 REPLIES 4
Read only

Former Member
0 Likes
476

try using the option "MAX" or sort the internal table by date

Read only

Former Member
0 Likes
476

Hi,

Select * into table itab from mseg as A inner join mkpf as B where Amblnr = Bmblnr where budat = budat.

sort itab Ascending by mblnr budat.

delete adjacent duplicates from itab comparing mblnr.

hope this helps.

regards

chandu.

Read only

0 Likes
476

Hi,

small change.

For latest date use descending not ascending.

regards

chandu

Read only

former_member15255
Active Participant
0 Likes
476

Hi,

SELECT AFIELD1 AFIELD2 MAX( bBUDAT )FROM MSEG A INNER JOIN BKPF AS B ON AMBLNR = B~MBLNR.

try this out i think this would solve ur problem

regards

suresh krishnan