Skip Headers
Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E17727-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

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.

Usage

OraTimeStampObj.AddIntervalYM operand
OraTimeStampTZObj.AddIntervalYM operand

Arguments

The arguments for the method are:

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

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 object represents.

Examples

Example: Using the OraTimeStamp Object

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 
 
... 

Example: Using the OraTimeStampTZ Object

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 
 
...