Daily / Monthly Report

32 views
Skip to first unread message

Karlo M.

unread,
May 15, 2012, 2:45:06 AM5/15/12
to rubyonra...@googlegroups.com
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/.

dsadaka

unread,
May 15, 2012, 5:21:04 AM5/15/12
to rubyonra...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages