Thanks for your help! Did you spot the mistake in the table?
DATETIMEOFFSET data type is a very precise way to define a point in time. This is why using the equality sign (
=) with this data type isn't a good idea. Two of these values may differ by a single nanosecond, and then the equality condition will not be satisfied. Nevertheless, you can use comparisons (i.e.
!=, etc.) with
DATETIMEOFFSET data to compare two columns, or a column with a constant value. Do we have to be very precise when providing the constant value? Not really. Take a look:
WHERE LaunchedDatetime > '2015-01-01';
As you can see, we compared a
DATETIMEOFFSET with a simple date. How is this possible? Well, our database converts the date we provided to
DATETIMEOFFSET by adding as many zeroes as necessary. For instance,
'2015-01-01' will become
'2015-01-01 00:00:00' and
'2014-02-12 12:00' will become
Convenient, isn't it?