Link to home
Start Free TrialLog in
Avatar of lancerxe
lancerxe

asked on

Crystal Report Selection Criteria

Hello experts:
I have a request from a client who wants a report that shows cash transactions
over 10,000 but if there's at least one transaction over 10,000 she wants
to see all cash transactions regardles of amount.
I have started with this but I'm stuck on the 2nd part of the request.
Any help would be greatlty appreciated.
LANCE  

(if  ($ToNumber({HISTORY.Cashin}) >= $10000) then($ToNumber({HISTORY.Cashin}) > $0))

With the code above, all I get is 10000 amounts
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lancerxe
lancerxe

ASKER

Thanks guys

mlmcc : You mentioned a stored procedure.
How would I go about creating a stored procedure for this.
thanks

You would do that in the database and the method depends on the database.

mlmcc
Kurt could a COMMAND do this?

mlmcc
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Created a SQL Expression called %10k
(
SELECT
  COUNT(AccountNumber)
FROM
  HISTORY
WHERE
  cast (CashInAmountInSplitDeposit as money) > 9999.99
)



Added this code
if ({%10k} > 1)

then($ToNumber({HISTORY.Cashinamountinsplitdeposit}) > $0))

Got an error message:
%10k field is unknown
mlmcc:

When I tried this:
if  ($ToNumber(Maximum({HISTORY.Cashin})) >= $10000) then
   FALSE
Else
  $ToNumber({HISTORY.Cashin}) < $10000)

got this error message:
This fucntion cannpt be used because it must be evaluated later
((Maximum({HISTORY.Cashin}) is highlighted)  

thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HISTORY.Cashinamountinsplitdeposit or HISTORY.Cashin  are the same field.
they are varchar.

Thanks for all your input. I will try all sugestions today.

One thing I noticed is that when I suppressed a section it was on the report as a blank line, so I would get 5 pages of blanks and then a good detail line, then 3 blank pages and another good detail line.
I'm wondering if the reason I get tons of blank line is because I'm using a group selection so if the group has no detials it still prints the group name folowed by a bunch of blank lines.

thanks again  
I don't know if you've solved the blank line issue that you mentioned, but if you're using group selection (not suppression), the groups that aren't selected won't be visible at all on the report.  Not the group header or footer, or the details in the group.

 OTOH, if you're suppressing a section (you mentioned suppressing a section _and_ group selection), that section won't show up on the report as a blank line.  However, if, for example, you suppress the group header and footer sections, but not the detail section, you'll still get the detail lines.  Or, if you suppress the group header section and the detail section, but not the group footer section, you'll still get the group footers.  So, it sounds like you were suppressing some sections, but not everything that you needed to.

 James