Forum: Rails-ES filtro solucionado :-D :-)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4845e8c7a2f5000a1f23ddcfebeea5bd?d=identicon&s=25 Guille (Guest)
on 2006-12-28 16:54
(Received via mailing list)
listo amigos el problema era tal al hacer un sum(total) me daba el
resultado
que queria PERO. el resultado salia en un campo llamado sum(total) y me
consulta era select fecha, tienda total sum(total) ............
al final quedo asi
select fecha, tienda, sum(total) as total .............. debi pensarlo
:S
mejor .. en fin ya sta :) Gracias..
code final metodo.
def filtrodia
@consultas = Consulta.find(:all, :select => "fecha,tienda, sum(total) as
total", :conditions => "'#{params[:fecha_inferior]}' <= fecha and
'#{params[:fecha_superior]}' >=  fecha and '#{params[:nombre_tienda]}' =
tienda", :group => "'fecha'")

end
 :-)
This topic is locked and can not be replied to.