Jump to content
We've recently updated our Privacy Statement, available here ×

Group Sales by Month Query


quique123
Go to solution Solved by ajinkya_c,

Recommended Posts

Im trying to design a SQL query to display all added sales from a partner_id grouped by month.

So I have this so far but im having trouble with the sql syntax.  Ive tried month(date), ive tried datepart(mm,date), ive tried date_format(date) and datename(date) but they all return sql error function does not exist in iReport Designer

 

select sum(account_invoice.amount_total), MONTH(account_invoice.create_date)MONTH from account_invoice where account_invoice.partner_id = 837 group by MONTH(account_invoice.create_date)[/code]
Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

select case to_char(date_invoice,'mm') when '01' then 'Enero' when '02' then 'Febrero' when '03' then 'Marzo' when '04' then 'Abril' when '05' then 'Mayo' when '06' then 'Junio' when '07' then 'Julio' when '08' then 'Agosto' when '09' then 'Septiembre' when '10' then 'Octubre' when '11' then 'Noviembre' when '12' then 'Diciembre' end from account_invoice
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...