Casi resolvi el problema sustituyendo "(date_invoice, 'mm')" por "coalesce(date_invoice, currente_date), 'mm')". Estoy usando Openerp para facturar, en este sistema se crea un pedido de ventas y luego se manda a facturar, cuando el documento llega al modulo de facturacion la fecha queda en blanco hasta que la persona encargada imprime la factura. Lo que me queda es ordenar por mes, pero cuando lo hago me crea varias lineas un mismo mes, sin el order by, quedan agrupados pero no en orden. SELECTcase to_char(coalesce(date_invoice, current_date),'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 as mes,sum(case type when 'out_invoice' then amount_untaxed else -amount_untaxed end) as ventaFROMaccount_invoice where type in ('out_invoice','out_refund')group bycaseto_char(coalesce(date_invoice, current_date),'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 [/code]