Skip to Content
0
Former Member
Jul 21, 2011 at 08:49 PM

Merging 2 sql queries into 1.

17 Views

Hi

Looking for single Query to find count of expired Items and count of items which will expire in next 90 days.

Actually i wanted to combine following 2 queries into single query.

1) Find count of expired Items

SELECT Item

COUNT(*)

INTO TABLE ITAB

FROM TEST_TABLE

WHERE END_DATE < SY-DATUM

GROUP BY Item.

2) Find Count of Item which will expire within 30 days.

SELECT Item

COUNT(*)

INTO TABLE ITAB

FROM TEST_TABLE

WHERE END_DATE > SY-DATUM

AND END_DATE < SYDATUM - 90

GROUP BY Item.

Pls. suggest me. Thanks...