I have a calculated column which is updated when two other columns are updated and the formula for this column is
SELECT(datediff(day,'2012-11-01 18:15:00.000','2012-10-22 11:59:58.000'))
It works fine for all other dates but when the month changes, then I get a negative value. How can I make sure this does not happen and I get the correct integer value?