Archives

SQL Script – Physical Inventory Count Sheets (RPPHIN)

  
              SELECT INM.Fac,
                       INM.fpartno,
                       INM.fdescript,
                       INM.frev,
                       INM.fcudrev,
                       CASE WHEN INM.fluseudrev = 1 THEN INM.fcudrev ELSE INM.frev END
                          AS fcdisprev,
                       INM.fmeasure,
                       INM.fsource,
                       --   ( + SQLSubStmt + ) AS ftotonhand,
                       INH.fbinno,
                       INH.flocation,
                       INH.fonhand AS fonhand,
                       INH.flot,
                       INH.fexpdate,
                       ISNULL (INHDl.fiQty, 0) AS PcCnt
                  FROM m2mdata01.dbo.inmast INM
                       JOIN dbo.inonhd INH
                       ON     INH.fac = INM.fac
                          AND INH.fpartno = INM.fpartno
                          AND INH.fpartrev = INM.frev
                       LEFT OUTER JOIN dbo.InOnHdDl INHDl
                       ON INHDl.fiInOnHdID = INH.identity_column
                 WHERE INM.fsource NOT IN ('P', 'F')

Related posts:

1 comment to SQL Script – Physical Inventory Count Sheets (RPPHIN)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>