SLN 函数
应用对象
Microsoft 365 专属 Access Access 2024 Access 2021 Access 2019 Access 2016
返回一个 Double 类型的值,指定单个周期内资产的直线折旧。
语法
SLN (成本、打捞、生命)
SLN 函数具有以下参数:
| 参数 | 说明 |
|---|---|
| 成本 | 必需。 双重 指定资产的初始成本。 |
| 打捞 | 必需。 在 资产的使用寿命结束时指定其值。 |
| 生活 | 必需。 指定资产的使用寿命长度的双精度值。 |
备注
折旧周期必须用与 life参数相同的单位表示。 所有参数都必须是正数。
查询示例
| Expression | 结果 |
|---|---|
| SELECT SLN ([LoanAmount],[LoanAmount]*.1,20) AS Expr1 FROM FinancialSample; | 返回价值为“LoanAmount”的资产的折旧值,其残值为 10% (“LoanAmount”乘以 0.1) ,考虑到该资产的使用寿命为 20 年。 |
| SELECT SLN ([LoanAmount],0,20) AS SLDepreciation FROM FinancialSample; | 返回价值为“LoanAmount”的资产的折旧值,其残值为 0 美元,考虑到该资产的使用寿命为 20 年。 结果显示在 SLDepreciation 列中。 |
VBA 示例
注意
下面的示例演示了如何在 Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在搜索旁边的下拉列表中选择“开发人员参考”,并在搜索框中输入一个或多个术语。
此示例使用 SLN 函数返回一个资产在一个时期的直线折旧值,给定资产的初始成本 (InitCost) 、资产使用寿命结束时的剩余价值 (SalvageVal) ,以及资产的总年限 (LifeTime) 。
Dim Fmt, InitCost, SalvageVal
Dim MonthLife, LifeTime, PDepr
Const YEARMONTHS = 12 ' Number of months in a year.
Fmt = "###,##0.00" ' Define money format.
InitCost = InputBox("What's the initial cost " & _
"of the asset?")
SalvageVal = InputBox("What's the asset's value " & _
"at the end of its useful life?")
MonthLife = InputBox("What's the asset's useful " & _
"life in months?")
' Ensure period is >= 1 year.
Do While MonthLife < YEARMONTHS
MsgBox "Asset life must be a year or more."
MonthLife = InputBox("What's the asset's " & _
"useful life in months?")
Loop
' Convert months to years.
LifeTime = MonthLife / YEARMONTHS
If LifeTime <> Int(MonthLife / YEARMONTHS) Then
' Round up to nearest year.
LifeTime = Int(LifeTime + 1)
End If
PDepr = SLN(InitCost, SalvageVal, LifeTime)
MsgBox "The depreciation is " & _
Format(PDepr, Fmt) & " per year."