This is probably a simple question. I have been asked to get a list of accounts that have closed within five years of the account being open.
I have a table called ACCOUNTS that contains the following columns:
ACCOUNT_ID,
DATE_OPENED,
DATE_CLOSED
I'm probably on the wrong track, but I've been trying to use DATEDIFF to figure out the number of days between the account's open and closed dates. One thing I definitely do not understanding is how to account of leap years. A five year period could have either one or two leap years. Does anyone have any suggestions on what the SELECT statement would look like?
I have a table called ACCOUNTS that contains the following columns:
ACCOUNT_ID,
DATE_OPENED,
DATE_CLOSED
I'm probably on the wrong track, but I've been trying to use DATEDIFF to figure out the number of days between the account's open and closed dates. One thing I definitely do not understanding is how to account of leap years. A five year period could have either one or two leap years. Does anyone have any suggestions on what the SELECT statement would look like?