Convert SQLDateTime back to date

Funnily the demo works on the same database , when using the old Date function. but not on my project. I will test multiple times so that it’s not random issue.