Yes. The OP's code doesn't seem to match his question, since it doesn't do any subtracting, but MySQL can give you the difference between two dates:
SELECT id, DATEDIFF(lastlogin, dateadded) FROM order_details;
Aaron B.
Available for small or large Perl jobs and *nix system administration; see my home node.
In reply to Re^2: Difference between dates
by aaron_baugher
in thread Difference between dates
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |