Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding specific Quarters together..

Status
Not open for further replies.

InShadows

IS-IT--Management
Jul 7, 2000
36
US
I am a beginner with Crystal Reports. I am currently using CR 8.5 and trying to fill out a client's reporting needs. The problem I am having is trying to create either A) sql statements with given parameters in them and b) using formulas to gather specific information. For instance, I would like to print the total expenditures for each quarter. The data is inserted on a monthly basis so I need to sum the values together. I am trying to sum them according to the database value of PEMonth. PEMonth relates to the month that it is for. I would love if CR was much more malleable like asp or php. I haven't found a way to do specific SQL statements either like

select
TotalExpenditures as TEValue
from
ProgExpenditures
where
ContractID = ?ContractID(parameter) and PEMonth=7 or
ContractID = ?ContractID and PEMonth=8 or
ContractID = ?ContractID and PEMonth=9

Sum(TEValue)

That would be my ideal formula/sql statement combination..
any advise getting closer to this ideal situation would be most appreciated..
 
Let CR do the SQL.

You should create a "range" parameter that allows them to pick a low and high month number.

Then create a select expert rule that says
Month - is equal to - ?param

(an equal to applied to a range will become a between)

Then you can group by month, and add a subtotal (if desired) and a grand total. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top