Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

AddIntervalYM Method

Applies To

OraTimeStamp Object

OraTimeStampTZ Object

Description

Adds an interval that represents an interval from years to months, to the OraTimeStamp or OraTimeStampTZ object.

Arguments

[in] operand
A Variant of type String, a numeric value, or an OraIntervalYM that represents an interval from years to months, to be added to the current OraTimeStamp or OraTimeStampTZ object.
Usage

OraTimeStampObj.AddIntervalYM operand

OraTimeStampTZObj.AddIntervalYM operand

Remarks

The result of adding an interval to the current OraTimeStamp or OraTimeStampTZ object is stored in the current object, overwriting any previous value. There is no return value.

If operand is a Variant of type String, it must be in following format: [+/-]YEARS-MONTHS.

If operand is a numeric value, the value provided should represent the total number of years that the constructed OraIntervalYM represents.

Example

Using OraTimeStamp

Dim OraTimeStamp As OraTimeStamp

...

'Create OraTimeStamp using a string

Set OraTimeStamp = OraSession.CreateOraTimeStamp("2000-12-28

    00:00:00", "YYYY-MM-DD HH:MI:SS")

'Add an interval using numeric value that represents 2 years

OraTimeStamp.AddIntervalYM 2

'Value should now be "2002-12-28 00:00:00"

tsStr = OraTimeStamp.Value

...

Using OraTimeStampTZ

Dim OraTimeStampTZ As OraTimeStampTZ

...

'Create OraTimeStampTZ using a string

Set OraTimeStampTZ = OraSession.CreateOraTimeStampTZ("2000-12-28

    00:00:00 -07:00", "YYYY-MM-DD HH:MI:SS TZH:TZM")

'Add an interval using numeric value that represents 2 years

OraTimeStampTZ.AddIntervalYM 2

'Value should now be "2002-12-28 00:00:00"

tstzStr = OraTimeStampTZ.Value

...