View_quality Shift Report

download View_quality Shift Report

of 3

Transcript of View_quality Shift Report

  • 7/31/2019 View_quality Shift Report

    1/3

  • 7/31/2019 View_quality Shift Report

    2/3

    SET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGO

    ===============================================================v1:=========SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ONGO

    CREATE view v_quality_report_childasselect workorder.wonum wonum,workorder.parent parent,workorder.description description,workorder.eqnum eqnum,equipment.description eqdescription,workorder.location location,locations.description locdescription,workorder.problemcode problemcode

    ,workorder.reportdate reportdate,workorder.actstart actstart,workorder.worktype worktype,workorder.status status,workorder.wo6 ncmr,workorder.wo10 processcomments,workorder.siteid siteid,locations.siteid locsiteid,equipment.siteid eqsiteid,failureremark.description faildescription,longdescription.ldtext longdesc,longdescription2.ldtext faillongdescfrom ((((workorder with (NOLOCK) left outer join equipment with (NOLOCK) on work

    order.eqnum = equipment.eqnum and workorder.siteid = equipment.siteid)left outer join locations with (NOLOCK) on workorder.location = locations.location and workorder.siteid = locations.siteid)left outer join failureremark with (NOLOCK) on workorder.wonum = failureremark.wonum and workorder.siteid = failureremark.siteid)left outer join longdescription with (NOLOCK) on workorder.ldkey = longdescription.ldkey and longdescription.ldownertable = 'WORKORDER' and longdescription.ldownercol = 'DESCRIPTION')left outer join longdescription as longdescription2 with (NOLOCK) on failureremark.ldkey = longdescription2.ldkey and longdescription2.ldownertable = 'FAILUREREMARK' and longdescription2.ldownercol = 'DESCRIPTION'where workorder.siteid = 'LFSS' and workorder.parent is not null

    GOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGO

    ========v2:===========

  • 7/31/2019 View_quality Shift Report

    3/3

    SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ONGO

    CREATE view v_quality_report_parentasselect workorder.wonum wonum,workorder.description description,workorder.eqnum eqnum,equipment.description eqdescription,workorder.location location,locations.description locdescription,workorder.problemcode problemcode,workorder.reportdate reportdate,workorder.actstart actstart,workorder.worktype worktype,workorder.status status,workorder.wo6 ncmr,workorder.wo10 processcomments,workorder.siteid siteid,locations.siteid locsiteid

    ,equipment.siteid eqsiteid,failureremark.description faildescription,longdescription.ldtext longdesc,longdescription2.ldtext faillongdesc,locancestor.ancestor ancestor,isnull(wo3,wo4) lotnumfrom (((((workorder with (NOLOCK) left outer join equipment with (NOLOCK) on workorder.eqnum = equipment.eqnum and workorder.siteid = equipment.siteid)left outer join locations with (NOLOCK) on workorder.location = locations.location and workorder.siteid = locations.siteid)left outer join failureremark with (NOLOCK) on workorder.wonum = failureremark.wonum and workorder.siteid = failureremark.siteid)left outer join longdescription with (NOLOCK) on workorder.ldkey = longdescripti

    on.ldkey and longdescription.ldownertable = 'WORKORDER' and longdescription.ldownercol = 'DESCRIPTION')left outer join longdescription as longdescription2 with (NOLOCK) on failureremark.ldkey = longdescription2.ldkey and longdescription2.ldownertable = 'FAILUREREMARK' and longdescription2.ldownercol = 'DESCRIPTION')left outer join locancestor with (NOLOCK) on workorder.location = locancestor.locationwhere workorder.siteid = 'LFSS' and workorder.worktype in ('EWR', 'EDM', 'EEM')and workorder.parent is null and haschildren ='Y'

    GOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGO