correct the datetime to date in sql datebase