Working on DateTime functions and null values