Hi everyone!
First time posting, also relatively new to SQL so I apologise if this is a silly question.
I'm looking to project the current monthly sales to the end of month to see what our current run rate is.
I am able to get the current date by using current_date (despite the () breaking it for some reason).
My issue comes from trying to either use EOMONTH or a formula like the one below to return the number of days in the month so I can then calculate.
SELECT DAY(DATEADD(DD,-1,DATEADD(MM,DATEDIFF(MM,-1,'2022-10-01'),0))) (should return 31)
from what I can see dateadd doesn't appear when I'm writing in sql and I get an error when running the above isolated. Error = ERROR: column "dd" does not exist Position: 19
I'm being asked daily about the projected figures daily and currently have to manually calculate the multiplier (which is simple but too manual).
Are there any restrictions on doing this through Metabase? Or am I simply being silly and getting this wrong. Any advice is greatly appreciated!
Thank you and have a nice day!