‎2013 Jul 22 11:35 AM
hi,
i have 2 tables. one contains OBJ_NAME and TRKORR and the other contains AS4DATE and TRKORR.
In the first table are a lot of objects. One object is also named more than once.
That means:
1 Object has n TRKORR has 1 DATE. (For all the diffrents objects)
I need all the Objects with their MIN DATE.
At the end i should have every object once with it's min date.
If i didn't explain it good enough please ask me again.
Any Ideas for the Select Statement?
Regards,
Jan
‎2013 Jul 22 12:51 PM
SELECT p~obj_name min( as4date )
INTO CORRESPONDING FIELDS OF TABLE wa_obj_name
FROM ( e070 AS c
INNER JOIN e071 AS p ON p~trkorr = c~trkorr )
Where as4date <= dat_bis and as4date >= dat_von AND c~trfunction = tr_func
GROUP BY p~obj_name.
so far this code worked.
‎2013 Jul 22 11:45 AM
‎2013 Jul 22 12:34 PM
Hi Jan,
no worries.
Why not finish this thread and post the actual solution you found as well?
That way everybody can get something out of it.
- Lars
‎2013 Jul 22 12:51 PM
SELECT p~obj_name min( as4date )
INTO CORRESPONDING FIELDS OF TABLE wa_obj_name
FROM ( e070 AS c
INNER JOIN e071 AS p ON p~trkorr = c~trkorr )
Where as4date <= dat_bis and as4date >= dat_von AND c~trfunction = tr_func
GROUP BY p~obj_name.
so far this code worked.