Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Cross Tab Post Reply Post New Topic
Author Message
FastTaxi
Newbie
Newbie
Avatar

Joined: 21 Jul 2007
Location: Australia
Online Status: Offline
Posts: 7
Quote FastTaxi Replybullet Topic: Cross Tab
     Posted: 26 Feb 2008 at 5:44pm
Hi can anyone tell me how I could use a cross tab to add up the sum of the columns as shown here?
                                   Total     Column1        Column2
      Total        12:00       4              2                   2
                      15:00       1              1                   0
 
the 12:00 & 15:00 are times of the day and the columns hold the number of entries for the times. The times get their data from from a stored procedure, anyway all I want to know is how to get a grand total for each column. so it would look like
 Total     Column1        Column2
      Total        12:00       4              2                   2
                      15:00       1              1                   0
                                      5               3                  2
 
Cheers
FastTaxi
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 27 Feb 2008 at 4:49am

Hi,

Create a command object or view using the following sql
 
SELECT TM,COL1+COL2'Total',COL1,COL2 FROM TM
UNION
SELECT TM,sum(col1)+sum(col2)'Total',SUM(COL1)'COL1',SUM(COL2)'COL2' FROM TM
group by tm
 
Then once the report is create Create Summaries for Total Col1 Col2 no need for Cross Tab
 
Cheers
Rahul
IP IP Logged
FastTaxi
Newbie
Newbie
Avatar

Joined: 21 Jul 2007
Location: Australia
Online Status: Offline
Posts: 7
Quote FastTaxi Replybullet Posted: 27 Feb 2008 at 12:33pm
thanks I'll try it
FastTaxi
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum