Send feedback on this topic.
Teradata.Client.Provider
Equality Operator (TdPeriodTimestampWithTimeZone)
Example 



Teradata.Client.Provider Namespace > TdPeriodTimestampWithTimeZone Structure : Equality Operator
An instance of TdPeriodTimestampWithTimeZone.
An instance of TdPeriodTimestampWithTimeZone.
Compares two TdPeriodTimestampWithTimeZone structures to determine whether the left operand is equal to the right operand.
Syntax
'Declaration
 
Public Operator =( _
   ByVal left As TdPeriodTimestampWithTimeZone, _
   ByVal right As TdPeriodTimestampWithTimeZone _
) As Boolean
'Usage
 

Parameters

left
An instance of TdPeriodTimestampWithTimeZone.
right
An instance of TdPeriodTimestampWithTimeZone.

Return Value

A boolean is returned that indicates the result of the comparison.
Remarks

The beginning and ending bounds between the left and right operands are compared to determine whether the two periods are equal. The two periods are equal if the following is true:

    left.Begin == right.Begin && left.End == right.Begin

The value returned is true if the left is equal to the right, false otherwise.

Return Value Description
true

left and right are TdPeriodTimestampWithTimeZone.Null

-or-

left is equal to right.

false

left or right is Null

-or-

left is not equal to right.

Unlike comparison operators, Equality operators do not always return false when left and right operands are Null. Therefore the reverse condition can be considered true. TdDate implementation is very similar to the Nullable class in this regard.

Example
The following example shows that the Equality operator can safely be used in an if statement.
TdPeriodTimestampWithTimeZone x = TdPeriodTimestampWithTimeZone.Null;
TdPeriodTimestampWithTimeZone y = new TdPeriodTimestampWithTimeZone(
        new TdTimestampWithTimeZone(2008, 10, 10, 12, 10, 33, 0, new TimeSpan(8, 0, 0)), 
        new TdTimestampWithTimeZone(2008, 11, 30, 14, 11, 22, 0, new TimeSpan(8, 0, 0)));
            
if (x == y)
{
    // x is equal to y.
    Console.WriteLine(@"X is equal to Y").
}
else
{
    // x is not equal y
    Console.WriteLine(@"X is not equal to Y").
}
            
y = TdPeriodTimestampWithTimeZone.Null;
            
if (x == y)
{
    // x is equal to y.
    Console.WriteLine(@"X is equal to Y").
}
else
{
    // x is not equal y
    Console.WriteLine(@"X is not equal to Y").
}
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

TdPeriodTimestampWithTimeZone Structure
TdPeriodTimestampWithTimeZone Members