Print Page | Close Window

Using Max Parameter Value for Record Select

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=207
Printed Date: 02 May 2025 at 12:24pm


Topic: Using Max Parameter Value for Record Select
Posted By: jade
Subject: Using Max Parameter Value for Record Select
Date Posted: 11 Feb 2007 at 8:01pm

Hi,

 

I have employee sales records that are currently grouped by:  Region à District à Store à Employee Name.  The records are then sorted by sales date at the employee name level.   I also have a parameter that lets you select which time period you would like (?DateRange).  The problem I’m running into is that if an employee moves then they’ll appear under different store numbers. 

 

Is there any way to write a record select formula so that each employee’s sales records will be grouped based on the max value of the DateRange parameter?  For example:

 

In 200601, Jane was located in:

Region: New York

District: Buffalo

Store: 1234

 

But in 200603 she moved to:
Region: Pennsylvania

District:  Pittsburgh

Store: 2222

 

Is there anyway to have the records grouped/sorted so that all of Jane’s records fall under Pennsylvania, Pittsburgh, Store 2222 if the DateRange parameter values are 200601 – 200603?

 

Basically the store that falls under the max value of DateRange parameter will get credit for all earlier sales.




Replies:
Posted By: BrianBischof
Date Posted: 12 Feb 2007 at 12:04am
I did a similar post a couple days ago. What you need to do is use a Command object or a stored procedure to create a custom SQL statement to build the data you need. Check out the post here

http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=202 - http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=202




-------------
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>



Print Page | Close Window