The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
1 |
User | Count |
---|---|
16 | |
15 | |
11 | |
6 | |
6 |