Send feedback on this topic.
Teradata.Client.Provider
TdIntervalYear Constructor(Int32,Byte)



Teradata.Client.Provider Namespace > TdIntervalYear Structure > TdIntervalYear Constructor : TdIntervalYear Constructor(Int32,Byte)
Number of years.
Number of significant digits of the year.
An instance of TdIntervalYear is created from a year date component specified as an integer with precision specified as a byte.
Syntax
'Declaration
 
Public Function New( _
   ByVal years As Integer, _
   ByVal precision As Byte _
)
'Usage
 
Dim years As Integer
Dim precision As Byte
 
Dim instance As New TdIntervalYear(years, precision)
public TdIntervalYear( 
   int years,
   byte precision
)
public:
TdIntervalYear( 
   int years,
   byte precision
)

Parameters

years
Number of years.
precision
Number of significant digits of the year.
Exceptions
ExceptionDescription
The years parameter specifies a TdIntervalYear value less than TdIntervalYear.MinValue or greater than TdIntervalYear.MaxValue.
The precision parameter is less than the TdIntervalYear.MinPrecision or greater than the TdIntervalYear.MaxPrecision range of values.
The precision parameter is not large enough to represent the number of years.
Remarks

The allowable values of precision are from 1 to 4.

The number of years is evaluated against TdIntervalYear.MinValue and and TdIntervalYear.MaxValue to determine if the values are exceeded. If the values are not exceeded but the resulting years component exceeds the supplied precision value, an exception is generated.

For example, a year value of 99 and a precision of 1 will generate an exception. The TdIntervalYear.Years interval component cannot be represented in 1 significant digit, thus resulting in an invalid TdIntervalYear.

Negative years may be supplied to represent negative duration of time.

Requirements

Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also

Reference

TdIntervalYear Structure
TdIntervalYear Members
Overload List