Calculate Number of Days between Two Dates in Informix

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.

Published by

Rich

Just another IT guy.

Leave a Reply

Your email address will not be published. Required fields are marked *