Wednesday, October 29, 2014

Foundation Query for Historical Fixed Asset Depreciation Reporting in SSRS or SLB

Prior to version 2013 of Dynamics GP there was not Historical Depreciation Reporting.  Here is a query, which can be used as a foundation for reporting on depreciation using SmartList Builder or SQL Server Reporting Services (SSRS)


DECLARE @Year INT, @StartPeriod TINYINT, @EndPeriod TINYINT
Set @Year = '2015' --Sets the Year of the Report
Set @StartPeriod = '1' --Sets the Starting Period of the Report
Set @EndPeriod = '12' --Sets the Ending Period of the Report

select
FAM.ASSETID Asset_ID,
FAM.ASSETIDSUF Asset_Suffix,
FAM.ASSETDESC Asset_Description,
GLT.FAPERIOD 'Period',
GLT.FAYEAR 'Year',
--GLT.FA_Doc_Number, --Removes this column, not in versions prior to 2013
convert(char(10),GLT.DEPRFROMDATE,101) Dep_From_Date,
convert(char(10),GLT.DEPRTODATE,101) Dep_To_Date,
GLD.ACTNUMST Account,
GLM.ACTDESCR Acct_Description,
cast(GLT.AMOUNT as money) Amount
from FA00902 GLT
left join FA00100 FAM on GLT.ASSETINDEX = FAM.ASSETINDEX
left join GL00100 GLM on GLT.GLINTACCTINDX = GLM.ACTINDX
left join GL00105 GLD on GLT.GLINTACCTINDX = GLD.ACTINDX
where FAYEAR = @Year
and FAPERIOD between @StartPeriod and @EndPeriod

Order by GLT.FAPERIOD,FAM.ASSETID,FAM.ASSETIDSUF,GLD.ACTNUMST

1 comment:

  1. --GLT.FA_Doc_Number, --Removes this column, not in versions prior to 2013

    ReplyDelete