Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Syndicate_Admin
Administrator
Administrator

Dates in text format - sql query connection.

team good morning,

I have problems with the dates of several sql tables already nourished information which needs to be changed to date format.

they are displayed as follows:

20211125111517346

understanding that it would be the date plus the hour minutes seconds and milliseconds.

Anyone know how to fix it? since from powerbi does not let me change the format because I am in query mode.

would be of great help.

3 REPLIES 3
amitchandak
Super User
Super User

@Syndicate_Admin , if you using direct query my advice would be create a view and bring date and time from the database or write SQL if allowed in connection 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the reply,

The problem is that I have access to the tables from PowerBI, but I do not have write access, I could see that the field is text, you can see that the date impacts from a Now() (it seems to me) since when impacting it is only text and in the following format with milliseconds:

20211125111517346
Anonymous
Not applicable

HI @Anonymous,

I'd like to suggest you do these in t-sql query(e.g. left, right function) to extract the date and time part then transfer data types:

LEFT (Transact-SQL) - SQL Server | Microsoft Docs

RIGHT (Transact-SQL) - SQL Server | Microsoft Docs

BTW, the current power bi seems not support the millisecond(power bi data model table time values are ended to the second level), if you want to keep these values, you may need to create a new column to store them.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.