• Where is column Datetime coming from?

    You should post your DDL and some sample data as DML along with the results you want to see.