
November 19th, 2012, 11:02 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 1
Time spent in forums: 7 m 14 sec
Reputation Power: 0
|
|
|
Banking report
I have a report question for a bank. I am trying to find auto loans that were
opened within 10 days of any loan. The auto loan must have a term >= 36 months,
balance >= 5k and collateral =500 (new auto) or 600 (used auto). Below is what I have so far. Not sure how to proceed with this one.
SELECT
ACCOUNT.ACCOUNT_NUMBER AS ACCOUNT_NUMBER
FROM
CORE.ACCOUNT AS ACCOUNT
WHERE
EXISTS (SELECT LOAN.DUEDATE A3 FROM CORE.LOAN AS LOAN
WHERE
LOAN.PARENT_SERIAL=ACCOUNT.SERIAL AND
LOAN.CLOSE_DATE IS NULL AND LOAN.CHARGE_OFF_DATE IS NULL)
AND
EXISTS (SELECT 1 FROM CORE.LOAN AS LOAN
WHERE
LOAN.PARENT_SERIAL=ACCOUNT.SERIAL AND
LOAN.CLOSE_DATE IS NULL AND LOAN.CHARGE_OFF_DATE IS NULL
AND A3 BETWEEN LOAN.DUEDATE+5 AND LOAN.DUEDATE-5)
|