Calculate an object's time in a location

You can use the LC_SYM_DURATION subroutine in a complex User Symbolic to calculate the amount of time an object has been in any location for any reason within a specified period of time.

Subroutine name

LC_SYM_DURATION

Field type

Location fields

Example of use

You could calculate the time that an object has been on display by using this symbolic. You use the duration symbolic on just the exhibition Location Reasons, for example, Temporary Exhibition, Permanent Exhibition.

Argument syntax and parameters

The subroutine is a piece of code that uses ‘arguments’. An argument is a set of options that tells the subroutine what to do. The argument parameters are commonly separated by an exclamation mark.

The LC_SYM_DURATION subroutine argument structure is:

location^location!reason^reason!DateCriteria!Format

What the argument parameters mean

Argument parameter Required or optional? Explanation
location Optional The System IDs of Location terms, separated with '^'. If no Location IDs are specified, the system will report on all locations for the specified date range.
reason Optional The System IDs of Location Reasons to report, separated with '^'.
DateCriteria Optional (requires either location or reason)

Date range to report on. Enter in the format: YYYY-YYYY.

OR

#nD where 'n' is the number of days prior to today.

#nM where 'n' is the number of months prior to today.

#nY where 'n' is the number of years prior to today.

format Optional (requires either location or reason)

SUM just returns the total duration in days.

MONTH breaks down by months.

YEAR (default) breaks down by years.

Example of subroutine argument

This argument will report on the amount of time (in days) objects have had the location reasons Temporary Exhibit or Permanent Exhibit between 01 Jan 2010 and 31 Dec 2015..

!TE^PE!2010-2015!SUM

TE and PE are the system IDs of the location reasons Temporary Exhibit and Permanent Exhibit.