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
--GLT.FA_Doc_Number, --Removes this column, not in versions prior to 2013
ReplyDelete