Compare Date portion of Datetime in SQL -
i working sql , have 2 columns datetime field.
want compare date portion of these datetime fields , see if there different.
for example,
col1 | col2 '2010-01-02 23:58:00.000' | '2010-01-03 06:21:00.000' '2010-01-04 16:03:00.000' | '2010-01-04 21:34:00.000'
row1's dates different row2 same
i thinking datediff(day,col2,col1) < 1
//then different else same.
not sure how parse date compare 2 fields.
abs(datediff(day, col1, col2)) > 0
Comments
Post a Comment