i have the table as below,
i would like to find the max(account_opened_date), if there is null date is existing, i have to show null values.
Scenario1
Table1
CLIENTID ACCOUNTID ACCOUNT_OPENED_DATE
11562 3880 07/05/2012
11562 3884 08/05/2012
11562 3885 09/06/2012
11562 3886 10/06/2012
11562 3881 NULL
11562 3882 NULL
the results are as below.
CLIENTID ACCOUNTID ACCOUNT_OPENED_DATE
11562 3882 NULL
in the above scenario, i have to take null because, there is null values existing in account opened dates
Scenario2
Table1
CLIENTID ACCOUNTID ACCOUNT_OPENED_DATE
11563 3880 07/05/2012
11563 3884 08/05/2012
11563 3885 09/06/2012
11563 3886 10/06/2012
11563 3881 11/10/2011
11563 3882 10/22/2012
The results ARE AS below.
CLIENTID ACCOUNTID ACCOUNT_OPENED_DATE
11563 3882 10/22/2012
in the above scenario, i have to take 10/22/2012 because, there is no null values existing in account opened dates
PLEASE HELP!
Try this
Example: