Projecting Revenue Run Rate for the Month Postresql

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!

Hi @tfg_caleb
Your query is being executed on the database, so the error is coming from there, not Metabase.
https://stackoverflow.com/questions/28186014/how-to-get-the-last-day-of-month-in-postgres

Are you sure you're using Postgres, since there's no DATEADD function? https://stackoverflow.com/questions/27080505/dateadd-equivalent-in-postgresql

Hi Flamber,
Thank you for your response
That may indeed answer the question, I had been supplied the DATEADD code so it must've been in SQL rather than postresql
I believe the server does run in postgresql so thank you for that article!

I'm pretty much a beginner to these languages so it is difficult to spot these things. Thank you for clarifying and teaching me something!