|
|
SynopsisCalculate the date of the first day of a fiscal year. CODE ' FiscalStart
' http://www.utteraccess.com/wiki/index.php/FiscalStart ' Code courtesy of UtterAccess Wiki ' Licensed under Creative Commons License ' http://creativecommons.org/licenses/by-sa/3.0/ ' ' You are free to use this code in any application, ' provided this notice is left unchanged. ' ' rev date brief descripton ' 1.0 2011-10-06 original release ' Public Function fFiscalStart(TheDate As Date, FirstMonth As Byte) As Date ' Procedure: fFiscalStart ' DateTime: 06/10/2011 6:47:21 AM ' Description: returns the first day of fiscal year for the specified date '-- Const cstrProcedure = "fFiscalStart" On Error GoTo HandleError fFiscalStart = DateSerial(year(TheDate) + (month(TheDate) < FirstMonth), FirstMonth, 1) HandleExit: Exit Function HandleError: 'add custom error handler here 'ErrorHandle Err, Erl(), cstrModule & "." & cstrProcedure Resume HandleExit End Function
|
| This page has been accessed 558 times. This page was last modified 16:53, 11 October 2011 by Glenn Lloyd. Disclaimers |