Get maximum date from two different columns in a new columnn.

By Super Man

get maximum date from two different columns

if you want to get maximum date from two different columns you can like this:

select date1,date2,( (date1<date2)*date2 + (date2<date1)*date1 ) as maxdate
from table1.


if you want maximum date from field date1 and date2 and store into field date3 then you can use this formula:

update table1
set date3= ( (date1<date2)*date2 + (date2<date1)*date1 )

Get maximum date from two different columns in a new columnn.  (1123 Views)