Calculate difference between two dates

can’t find any documentation or help that can help me work out the difference between two dates. i.e. datediff(year,x,y) doesn’t work.

any advice from anyone?

Hi @SujjyCentral
Metabase doesn’t have such functionality in the interface currently, so you would have to use Native question to generate a date difference. - upvote by clicking :+1: on the first post

1 Like

Thank you. I don’t understand what you mean when you say, use native. Is this something I can import into Metabase? First time user here so a bit of a Newb

@SujjyCentral You would need to create a Native/SQL query. When you click “Ask a question”, you should see the option, if you have permissions to do that and if the database you’re using supports Native queries.

yes so I’m in that native query section right now but if i do datediff i get the error that it doesn’t exist

@SujjyCentral You have to give more information.
Please post “Diagnostic Info” from Admin > Troubleshooting.
And post the full error message.
Also, it would be helpful if you post your query too.
Could it be that the database you’re querying doesn’t have that function?

im looking the same solution as the mentioned problem, the problem already solved or not yet?

@enab23 Click the link to the issue I referenced above and upvote by clicking :+1: on the first post. It is not solved as of 0.38.0