DarkWorlds
Technical User
My first questions involves union
I am joining months of tables together all with the same fields. I am assuming union would be the best shot? But I need something that is quick.
Secondly when this is all said and done (all 12 tables into one) I need to get the max inactive date, and max active date. Well active date is no issue.
But the inactive date may have a date or it may be null. So how do I select the max date but if its null select that instead?
Sample
Client Name | Active Date | Inactive Date
Bob|5/12/2007|6/15/2007
Bob|7/18/2007|null
Sam|4/28/2007|5/20/2007
Sam|9/30/2007|10/15/2007
So the query should pull up
Bob|7/18/2007|null
Sam|9/30/2007|10/15/2007
I am joining months of tables together all with the same fields. I am assuming union would be the best shot? But I need something that is quick.
Secondly when this is all said and done (all 12 tables into one) I need to get the max inactive date, and max active date. Well active date is no issue.
But the inactive date may have a date or it may be null. So how do I select the max date but if its null select that instead?
Sample
Client Name | Active Date | Inactive Date
Bob|5/12/2007|6/15/2007
Bob|7/18/2007|null
Sam|4/28/2007|5/20/2007
Sam|9/30/2007|10/15/2007
So the query should pull up
Bob|7/18/2007|null
Sam|9/30/2007|10/15/2007