SQL - Getting Most Recent Date From Multiple Columns
- by ScottSEA
Assume a rowset containing the following
EntryID Name DateModified DateDeleted
-----------------------------------------------
1 Name1 1/2/2003 NULL
2 Name1 1/3/2005 1/5/2008
3 Name1 1/3/2006 NULL
4 Name1 NULL NULL
5 Name1 3/5/2008 NULL
I need to return the largest (i.e. most recent) non-null date from DateModified and DateDeleted, in this case 3/5/2008.