Getting day name in metabase

Hey guys!

I’ve been trying to group by day name using SQL queries in metabase but unfortunately I couldn’t.
There are multiple ways to do it in SQL server, like using DAYNAME, DATENAME functions, but those don’t work in metabase. Any idea how to use it? or if there’s a replacement?

Hi @khalid4294
Why are DAYNAME/DATENAME not working in Metabase, when you create a Native/SQL question?
Can you post the query?

This works for me:

select  orderid, OrderDate, datename(dw,OrderDate) as dayofweek FROM ORDERS

I get this error (Function not found: datename; Did you mean datetime? at [2:14])
on this simple query: select oid, datename(dw,createdAt) as days FROM Orders

doesn’t work for me, “function not found”

I’m running MS SQL Server 2017. It wasn’t available until SQL 2016. What version are you running?

yeah, turned out I’m using ANSI SQL 2011. I found another way to solve this.

select id, format_timestamp('%A', createdAt) as days FROM Orders

thanks everyone!