Below is the sql to extract data of same date
for the last 12 months.
I need data for all last 12 months
with same date and also with +/-3 days data.
Need help
Cap2010
proc sql;
SELECT IM.Area,
IM.Location,
IT.itemid,
IT.date,
IT.Qty,
IT.Rate,
IT.Amount
FROM DB.ITran as IT
INNER JOIN
DB.IMast as IM
ON IT.itemid = IM.itemid
WHERE IT.itemid="A101"
and (IT.date='01DEC2003'd
or IT.date='01DEC2003'd-30
or IT.date='01DEC2003'd-61
or IT.date='01DEC2003'd-91
or IT.date='01DEC2003'd-122
or IT.date='01DEC2003'd-153
or IT.date='01DEC2003'd-183
or IT.date='01DEC2003'd-214
or IT.date='01DEC2003'd-244
or IT.date='01DEC2003'd-275
or IT.date='01DEC2003'd-303
or IT.date='01DEC2003'd-334
or IT.date='01DEC2003'd-365)
order by IM.Area, IT.itemid, IT.date desc;
quit;
for the last 12 months.
I need data for all last 12 months
with same date and also with +/-3 days data.
Need help
Cap2010
proc sql;
SELECT IM.Area,
IM.Location,
IT.itemid,
IT.date,
IT.Qty,
IT.Rate,
IT.Amount
FROM DB.ITran as IT
INNER JOIN
DB.IMast as IM
ON IT.itemid = IM.itemid
WHERE IT.itemid="A101"
and (IT.date='01DEC2003'd
or IT.date='01DEC2003'd-30
or IT.date='01DEC2003'd-61
or IT.date='01DEC2003'd-91
or IT.date='01DEC2003'd-122
or IT.date='01DEC2003'd-153
or IT.date='01DEC2003'd-183
or IT.date='01DEC2003'd-214
or IT.date='01DEC2003'd-244
or IT.date='01DEC2003'd-275
or IT.date='01DEC2003'd-303
or IT.date='01DEC2003'd-334
or IT.date='01DEC2003'd-365)
order by IM.Area, IT.itemid, IT.date desc;
quit;