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



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

Parameters

years
Number of years.
months
Number of months.
precision
Number of significant digits of the year.
Exceptions
ExceptionDescription
The parameters specify a TdIntervalYearToMonth value less than TdIntervalYearToMonth.MinValue or greater than TdIntervalYearToMonth.MaxValue.
The precision parameter is outside the TdIntervalYearToMonth.MinPrecision or TdIntervalYearToMonth.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 - 4.

All values are converted into months and the values are added to determine if the TdIntervalYearToMonth.MinValue or the TdIntervalYearToMonth.MaxValue 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 200, a month value of 12,006 and a precision of 3 results in a value in total months of 12,206 months. The TdIntervalYearToMonth literal representation results in a TdIntervalYearToMonth value of 1,200 years and 6 months. The TdIntervalYearToMonth.Years interval component cannot be represented in 3 significant digits, therefore resulting in an invalid TdIntervalYearToMonth.

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdIntervalYearToMonth Structure
TdIntervalYearToMonth Members
Overload List