我一直试图从月份编号中找到年份的季度编号,即我有月份编号 2,它应该是季度编号 1,我如何在 Access VBA 或 Access 查询中执行此操作?
提前致谢。
最佳答案
您可以使用此功能:
Public Function Quarter(ByVal MonthNumber As Long) As Long
If (MonthNumber < 1) Or (MonthNumber > 12) Then
Call Err.Raise(6) ' Value out of Bounds '
End If
Let Quarter = (MonthNumber - 1) \ 3 + 1
End Function
关于vba - Access VBA 从月数中获取季度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26426648/