Forum Discussion
Change datetime format to date in SQL
- Anonymous8 years ago
The createtime column is in datetime format.
Only the cast(createtime as date) works for me. The result is in the format of datetime too.
Is that possible to direct convert it to date format without using query M?
The createtime column is in datetime format.
Only the cast(createtime as date) works for me. The result is in the format of datetime too.
Is that possible to direct convert it to date format without using query M?
Date format is DateTime only set to midnight.
- DataAnalyst214 years agoNew Member
That's obvious and is clearly not the question.
You are aware that in M there's a data type Date that removes the Time component completely? So why when in SQL you explicitly CAST DateTime as DATE PowerQuery is not picking it up as Date data type but instead is treating it as DateTime with 00:00:00 in the time part? It looks ugly and is confusing.
- nohowUp_fnDown3 years agoAdvocate I
Any updates on this or do I have to explicitly FIX every date column in Power BI? It's a complete pain when you've already specified it as a DATE data type in Microsoft SQL Server.