if you want simply to display the date difference in rows that you have already selected and returned into coldfusion, then there's no harm in using coldfusion's date functions
but often you will want to select rows based on the difference
in this case, you do not want to return the entire table (thousands of rows?) just to do the calculation in coldfusion to find out there's only a dozen rows that qualify
that's when it's important to do the calculation in mysql
Code:
select foo, bar
from yourtable
where to_days(complete_date)
- to_days(start_date) < 10
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.