Databases

Calculate Number of Days between Two Dates in Informix

April 20, 2012 Rich 1 min read

This is how I calculate the number of days between two dates.
Suppose I have a small table:

Customer
Name
LastLogon
select current year to day - extend(customer.lastlogon, year to day)

You can use MINUTE, HOUR, SECOND as well to get a little more granular.

Leave a comment