Thursday, October 21, 2010

How To Find the Accounts used by an Asset

Below is a query to find what are the accounts used in Fixed Assets.


-----

SELECT FA00100.ASSETID, FA00100.ASSETIDSUF, FA00100.ASSETDESC, FA00100.LOCATNID, FA00100.ASSETSTATUS,
GL00105_1.ACTNUMBR_2 AS DepreciationExpenseLocation, GL00105_1.ACTNUMST AS DepreciationExpenseAccount,
GL00105.ACTNUMBR_2 AS DepreciationReserverLocation, GL00105.ACTNUMST AS DepreciationReserveAccount,
GL00105_2.ACTNUMBR_2 AS PriorYearDepreciationLocation, GL00105_2.ACTNUMST AS PriorYearDepreciationAccount,
GL00105_3.ACTNUMBR_2 AS AssetCostLocation, GL00105_3.ACTNUMST AS AssetCostAccount, GL00105_4.ACTNUMBR_2 AS ProceedsLocation,
GL00105_4.ACTNUMST AS ProceedsAccount, GL00105_5.ACTNUMBR_2 AS GainandLossLocation, GL00105_5.ACTNUMST AS GainandLossAccount,
GL00105_6.ACTNUMBR_2 AS NonRecognizedLocation, GL00105_6.ACTNUMST AS NonRecognizedAccount, GL00105_7.ACTNUMBR_2 AS ClearingLocation,
GL00105_7.ACTNUMST AS ClearingAccount
FROM FA00400 INNER JOIN
FA00100 ON FA00400.ASSETINDEX = FA00100.ASSETINDEX INNER JOIN
GL00105 ON FA00400.DEPRRESVACCTINDX = GL00105.ACTINDX INNER JOIN
GL00105 AS GL00105_2 ON FA00400.PRIORYRDEPRACCTINDX = GL00105_2.ACTINDX INNER JOIN
GL00105 AS GL00105_3 ON FA00400.ASSETCOSTACCTINDX = GL00105_3.ACTINDX INNER JOIN
GL00105 AS GL00105_4 ON FA00400.PROCEEDSACCTINDX = GL00105_4.ACTINDX INNER JOIN
GL00105 AS GL00105_5 ON FA00400.RECGAINLOSSACCTINDX = GL00105_5.ACTINDX INNER JOIN
GL00105 AS GL00105_6 ON FA00400.NONRECGAINLOSSACCTINDX = GL00105_6.ACTINDX INNER JOIN
GL00105 AS GL00105_7 ON FA00400.CLEARINGACCTINDX = GL00105_7.ACTINDX LEFT OUTER JOIN
GL00105 AS GL00105_1 ON FA00400.DEPREXPACCTINDX = GL00105_1.ACTINDX


---

No comments:

Post a Comment