Re: Oracle Query!!!
THis is the whole query:
SELECT
cat_prb_codeset.code as code,
cat_prb_codeset.description,
fwwipstep.stepname as currentstep,
cat_prb_lot.prrnumber as prrnumber,
cat_prb_lot.lotid as lotid,
cat_prb_lot.planid as planid,
cat_prb_lot.productid as productid,
cat_prb_lot.quantity as quantity,
cat_prb_lot.serialnumber as serialnumber,
cat_prb_lot.returnstep as returnstep,
cat_prb_lot.disposition as disposition,
cat_prb_lot.dispositiondate as dispositiondate,
cat_prb_lot.uaijustification as uaijusitification,
cat_prb.originateddate as origindate,
cat_prb.originatedstep as originstep,
cat_prb.prbcomment as prbcomment,
cat_prb.prbstatus as prbstatus,
cat_prb.rootcausecode as rootcausecode,
cat_prb.revisionby as revisionby,
cat_prb.revisiondate as revisiondate,
cat_prb.documentids as documentids,
cat_prb.closedate as closedate,
cpa1.attributevalue as business,
cpa2.attributevalue as family,
cpa3.attributevalue as model,
FWLOT_PN2M.VALDATA as lotlevel,
FWLOT.SYSID as sysid,
FWLOT.processingstatus as processingstatus,
FWLOT.lasttransactiontime as lasttransactiontime
from fw.cat_prb_lot,fw.cat_prb_codeset,fw.fwwipstep,fw.fwlot,fw.fwlot_n2m,fw.cat_prb,
fw.cat_product_attributes cpa1,fw.cat_product_attributes cpa2,fw.cat_product_attributes cpa3, fw.fwlot_pn2m
where
CAT_PRB.PRRNUMBER = CAT_PRB_LOT.PRRNUMBER AND
CAT_PRB.PRRNUMBER = CAT_PRB_CODESET.PRRNUMBER AND
CAT_PRB.CODESETREV = CAT_PRB_CODESET.CODESETREV AND
CAT_PRB_LOT.LOTID =FWLOT.APPID AND
CAT_PRB_LOT.PRODUCTID = cpa1.PRODUCTNAME(+) AND
cpa1.attributename='Business' and
CAT_PRB_LOT.PRODUCTID = cpa2.PRODUCTNAME(+) AND
cpa2.attributename='Family' and
CAT_PRB_LOT.PRODUCTID = cpa3.PRODUCTNAME(+) AND
cpa3.attributename='Model' and
FWLOT.SYSID = FWLOT_N2M.FROMID AND
fwlot.sysid=FWLOT_PN2M.FROMID AND
FWLOT_PN2M.VALDATA = '90 Production' and
FWLOT_N2M.TOID = FWWIPSTEP.SYSID AND
CAT_PRB_CODESET.CODETYPE = 'R' AND
FWWIPSTEP.STEPNAME LIKE 'TTT%' and Cat_prb.ORIGINATEDDATE > '20081205' or cat_prb.CLOSEDATE > '20081205'
But it is not working, how can I do this??? I want that the information that is presented are the TTT that are opened and closed where the origindate and close date is > than the dateselected.