Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: how do i sql this? Post Reply Post New Topic
Author Message
sqlnoob
Newbie
Newbie


Joined: 15 Oct 2008
Location: United States
Online Status: Offline
Posts: 4
Quote sqlnoob Replybullet Topic: how do i sql this?
    Posted: 27 Oct 2008 at 8:45am
i have a  CR that list the weekly payroll for people in my company.
 
it is a flat file like so
 
 
first name last name    payment       payment date
tom           johns                5000K               1/20/2008
jack           hamoke            4000K             1/20/2008
..........................
 
now that i have the data i need to show in the header of the report
something like this (i have no idea where or how do i put the sql that can do below) i just need the total
 
people how made   $1000  to  $2000   =  10
people how made   $2001  to  $5000   =  30
and so on
thanks guys
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 27 Oct 2008 at 1:41pm
This is a bit tricky to get it fully implemented b/c it consists of two steps. The first step is to get the formula correct for what you want to do. You would have to have a formula like this:
Global NumberVar Tier1;
Global NumberVar Tier2;
Select {yourtable.payment}
Case 1000 To_ 2000:
    Tier1 := Tier1 + 1
Case 2000 To_ 3000:
    Tier2 := Tier2 + 1;
;
This tracks how many people are in each tier and stores it in global variables. The problem is that you only put this at the end of the report because it is a manual running total and only does the calculations as the report runs. So to put it in the header, step 2 would be to create a subreport that uses the same data as the main report and includes this formula. Then you can print the values in the subreport and include the subreport in the main report's header. A little tricky. but perfectly doable.
 
If you want to learn more about advanced report design, you can check you my Encylcopedia book for tutorials on how to use formulas as well as subreports. You can find out more about my books at [url=http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20]Amazon.com[/url] or reading the [url=http://members.crystalreportsbook.com]Crystal Reports eBooks[/url] online.
 
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.