(This is related to Floor a date in SQL server.)
Does a deterministic expression exist to floor a DATETIME? When I use this as a computed column formula:
DATEADD(dd, DATEDIFF(dd, 0, [datetime_column]), 0)
the I get an error when I place an index on that column:
Cannot create index because the key column 'EffectiveDate' is non-deterministic or imprecise.
But both DATEDIFF and DATEADD are deterministic functions by definition. Where is the catch? Is it possible?