I happened to need this for something else so, since I was looking it up anyways here is the SQL that will give you a difference on the number of days when added to a calculated field.
ex.
DATEDIFF( day , LastCostAdj.Calculated_LastCostAdj , Constants.Today )
what they mean
DATEDIFF( Interval*day,month,year, hour*, First date , second date )
link to the SQL that will give you all the options.
Is this what you did? What error were you getting?