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



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

Parameters

years
Number of years.
months
Number of months.
Exceptions
ExceptionDescription
The parameters specify a TdIntervalYearToMonth value less than TdIntervalYearToMonth.MinValue or greater than TdIntervalYearToMonth.MaxValue.
Remarks

The number of years and months are converted into months first and then evaluated against TdIntervalYearToMonth.MinValue and TdIntervalYearToMonth.MaxValue. The TdIntervalYearToMonth.Precision is then calculated from the number of digits contained within the interval year component.

For example, a year value of 99 and a month value of 45 results in a value in total months of 1233 months. The TdIntervalYearToMonth literal representation results in a TdIntervalYearToMonth value of 102 years and 9 months within the range of less than or equal to MaxValue and greater than or equal to the MinValue. Precision is calculated to be a value of 3 representing 3 significant digits in the year.

A year value of 200 and a month value of 118,000 results in a value in total months of 120,400 months. The TdIntervalYearToMonth literal representation results in a TdIntervalYearToMonth value of 10,033 years and 4 months exceeding the maximum value of '9999-11'.

Negative constructor parameters may be supplied to represent negative durations of time. Mixed positive and negative constructor parameters are added together that result in a negative or positive TdIntervalYearToMonth. For instance, a year value of 200 and a month value of -4900 will result in a TdIntervalYearToMonth interval value of -'208-04' with a calculated precision value of 3.

Requirements
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdIntervalYearToMonth Structure
TdIntervalYearToMonth Members
Overload List