This is your basic "cross-tab" report. However, since you did not provide a layout of your table(s), it's not really possible to help you with the query.
So, perhaps this will help: http://www.simple-talk.com/sql/t-sql-programming/creating-cross-tab-queries-and-pivot-tables-in-sql/ or you can google "crosstab reports in rails" HTH, Dan On Tuesday, May 15, 2012 2:45:06 AM UTC-4, Ruby-Forum.com User wrote: > > Report > > I need to create a daily report + monthly report with this records.. > > Calls > Texts > Emails > > Is there any possible way to create a single query that will > generate this daily report + monthly report.? > > Ex. > > Day1 Day2 Day3 etc.. Total > Calls 20 23 23 ... 66 > > Texts 120 125 130 ... 375 > > Emails 50 60 55 ... 165 > > Total 190 208 208 ... 606 > > > If not, please tell how to do it the simplest way, and how to this on > rails.? > > Thanks in advance... > > -- > Posted via http://www.ruby-forum.com/. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MSBsbzsBiqEJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

