Article ID: 210249 - Last Review: October 11, 2006 - Revision: 2.2 HOW TO: Get the Fiscal Year or Month of a Particular Date in Access 2000This article was previously published under Q210249 On This PageSUMMARY
This article shows you how to get the fiscal year or fiscal month
of a particular date by using an expression or a user-defined function. Using an Expression to Get the Fiscal Year or Fiscal MonthNOTE: This section applies only to a Microsoft Access database (.mdb).To get the fiscal year or fiscal month of a particular date by using an expression, follow these steps:
Field: FYear: Year([FieldName])-IIf([FieldName]< _
DateSerial(Year([FieldName]),9,15),1,0)
Field: FMonth: (Month([FieldName])+IIf(Day([FieldName])<15,9,10)-1) _
Mod 12+1
Field: FYear: Year([FieldName])-IIf([FieldName]< _
DateSerial(Year([FieldName]),9,15),1,0)+1
Using Sample Functions to Get the Fiscal Year or Fiscal MonthNOTE: This section applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To get the fiscal year or fiscal month of a particular date by using user defined functions, follow these steps:
REFERENCESFor more information about the DateSerial function, click Microsoft Access Help on the Help menu, type DateSerial, Day, Month, and Year function examples in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
