I have two columns in a table which need to be compared against the data.The problem that I am facing is that each of the columns have different datatypes: float
and datetime2
.
EventID EventStartDate
------- ---------------------------
201605 2017-09-21 12:40:29.9800000
201504 2017-09-21 12:40:46.8430000
201606 2017-09-21 12:41:39.3370000
201609 2017-09-21 12:41:57.3100000
Now, I have to compare the values in the column named EventID
with the values in the column named EventStartDate
; e.g., I need to compare the year and month in '201605' with the year and month parts of '2017-09-21 12:40:29.9800000'.