Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Attempting to use code that works in SSMS summarizing table by date and formatting the date to 'yyyy-MMM-dd'.
The cell code throws anerror : “an implementation is missing scala.Predef$.$qmark$qmark$qmark(Predef.scala:288) com.microsoft.fabric.spark.catalog.OnelakeExternalCatalog.functionExists(OnelakeExternalCatalog.scala:386) com.microsoft.fabric.spark.catalog.InstrumentedExternalCatalog.$anonfun$functionExists$1(OnelakeExternalCatalog.scala:607…)
I have tried the convert equivalent and also casting the field to a date prior to format. Still receive an error. Ive exhausted my googling capabilities today – everything that I read says that it should work.
Solved! Go to Solution.
Hey @davemc69,
You're using T-SQL syntax in a Spark SQL environment - FORMAT doesn't exist in Spark.
Working Solutions:
SELECT COUNT(1) AS RecordCount,
DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd') AS FormattedDateField
FROM lakehouse.Schema.TableName
WHERE DateTime2_Column >= '2024-01-01'
GROUP BY DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd')
ORDER BY DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd') DESC;
2. Simple CAST approach (faster for large tables):
SELECT COUNT(1) AS RecordCount,
CAST(DateTime2_Column AS DATE) AS FormattedDateField
FROM lakehouse.Schema.TableName
WHERE DateTime2_Column >= '2024-01-01'
GROUP BY CAST(DateTime2_Column AS DATE)
ORDER BY CAST(DateTime2_Column AS DATE) DESC;
Additional Tips:
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Hi @davemc69,
We haven’t heard back from you in a while regarding your issue. let us know if your issue has been resolved or if you still require support
Thank you.
Hi @davemc69,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
Hi @davemc69
I can see that FORMAT is visible in DimDate, even with shortcut mode as well in my version of SSMS. or am I missing something?
Hey @davemc69,
You're using T-SQL syntax in a Spark SQL environment - FORMAT doesn't exist in Spark.
Working Solutions:
SELECT COUNT(1) AS RecordCount,
DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd') AS FormattedDateField
FROM lakehouse.Schema.TableName
WHERE DateTime2_Column >= '2024-01-01'
GROUP BY DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd')
ORDER BY DATE_FORMAT(DateTime2_Column, 'yyyy-MM-dd') DESC;
2. Simple CAST approach (faster for large tables):
SELECT COUNT(1) AS RecordCount,
CAST(DateTime2_Column AS DATE) AS FormattedDateField
FROM lakehouse.Schema.TableName
WHERE DateTime2_Column >= '2024-01-01'
GROUP BY CAST(DateTime2_Column AS DATE)
ORDER BY CAST(DateTime2_Column AS DATE) DESC;
Additional Tips:
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer