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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
cw88
Helper IV
Helper IV

Fabric lakehouse table: try_convert not working

Hi, 

i try to use try_convert to convert varchar to date. The column includes some underscores:

cw88_1-1689748862194.png

 

When i use the try_convert, i get a conversion error:

cw88_0-1689748793646.png

In my opinion, this should not happen, or am I missing something?

 

Thanks!

 

2 REPLIES 2
rocketporg
Advocate I
Advocate I

I've got the same problem with a script of mine, using CONVERT. This feels like a bug, but Fabric is still in preview so some of this is to be expected...

 

But yes, there seems to be an issue here. Interestingly if you take the SQL code and hard code the date as a string and run it then it works fine (see below), just seems to be when doing it with a column from a table...

 

Works fine:-

SELECT TRY_CONVERT(DATE, '2023-03-01')

 

This script below however, you get the error message. Even if every row has value '2023-03-01':-
SELECT TRY_CONVERT(DATE, SomeField) FROM SomeTable

Hi @rocketporg ,

thanks, i can reproduce this behavour. I opened a bug ticket.

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.