CasewareDocs

SetFilePeriod

Some audits like tax and statutory audits are done for a specific period and require the data from these periods. Now it is possible to enter the period for each audit test requiring a period. SmartAnalyzer also offers another possibility: the global period parameters. This kind of parameter can be specified for a folder and/or for a database. If you set a period for a folder, this period will apply to all databases within this folder except for the databases for which a specific period was set on database level.

With SetFolderPeriod you can set a period for all databases in a directory. Use SetFilePeriod to set the period for a single database. The period set for a single database has priority over the period set for all databases in the directory.

Compatibility

Available as of IDEA version 9.2

Syntax

SetFilePeriod(fileName as String, from as Date, to as Date)

Parameters

fileName

The name of the database.

from

The start date of the period.

to

The end date of the period.

The database name may be absolute as well as relative to project folder. An empty database name (null or "") designates primary input database.

Example

Sub Main 
Dim SimpleCommands As Object
Dim mc As Object
Dim dbName As String
Dim startDate As Date
Dim toDate As Date

Set mc = SmartContext.MacroCommands
Set SimpleCommands = mc.SimpleCommands

startDate = DateSerial(2010,1,1)
toDate = DateSerial(2013,12,31)

Set dbName = SmartContext.PrimaryInputFile
SimpleCommands.SetFilePeriod dbName, startDate, toDate
End Sub
SetFilePeriod | Caseware Docs