Duffy,
This query pulls both potential sources of Standard Costs Changes - CT00003 and IV00101 (Inventory) as well as the ICIV0323 (Manufacturing)
Any pending changes entered into the Standard Item Material Costs window will be reflected in the CT00003 table and rolled into the IV00101 standard cost.
Changes made in the Standard Cost Maintenance window are also used. These values are stored in the ICIV0323 table.
------------------
select
'Manufacturing' 'Source',
SCM.ITEMNMBR Item_ID,
IVI.ITEMDESC Item_Description,
cast(SCM.TOTALCOSTI_1 as money) Current_Cost,
Convert(varchar(10),SCM.MATCOSTEFFDATEI_1,101) CC_Effective_Date,
cast(SCM.TOTALCOSTI_3 as money) Pending_Cost,
Convert(varchar(10),SCM.MATCOSTEFFDATEI_3,101) PC_Effective_Date,
COA.ACTNUMST SC_Reval_Acct
from ICIV0323 SCM
inner join IV00101 IVI on IVI.ITEMNMBR = SCM.ITEMNMBR
Left Join GL00105 COA on IVI.IVSCRVIX = COA.ACTINDX
Union All
select
'Inventory' 'Source',
SCID.ITEMNMBR Item_ID,
SCID.ITEMDESC Item_Description,
cast(IVC.STNDCOST as Money) Current_Cost,
convert(varchar(10),IVC.MODIFDT,101) CC_Effective_Date,
cast(SCID.COST_I as Money) Pending_Cost ,
convert(varchar(10),SCID.EFFECTIVEDATE_I,101) PC_Effective_Date,
COA.ACTNUMST SC_Reval_Acct
from CT00003 SCID
Inner Join IV00101 IVC
on SCID.ITEMNMBR = IVC.ITEMNMBR
Left Join GL00105 COA
on IVC.IVSCRVIX = COA.ACTINDX
order by Item_ID,Source
------------------