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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to print record for last 3 dates based on criteria

Status
Not open for further replies.

timISST

MIS
Jun 12, 2012
35
US
I ahve been trying to get this to work based on a start and end date (Past 5 working days) the report needs to show the following
Last 3 dates it happened for J when

6/16/12 Y
6/1/12 Y
5/15/12 y

show J or if 1 of the 3 comes back N then do not print any ideas
 
You probably need a summary count, but these don't include the formula option you get with running totals. You can get the same effect by doing the summary count on a formula field, e.g.
Code:
if @InDateRange
and @HappensForJ
then 1
else 0
The broader use of Crystal's automated totals is outlined at FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
First you would group on the field that returns "J"--let's say it is {table.client} and that the field that returns Y or N is {table.status}. Also sort by the date field in descending order.

Then create a formula {@hasN} like this:

if {table.status} = "N" then 1

Then go to report->selection formula->GROUP and enter:

sum({@hasN},{table.client})=0

In the field explorer, also insert a running total {#cntwingrp} that does a count of {table.client}, evaluate for each record, reset on change of group: client.

Then go into the section expert->details->suppress->x+2 and enter:

{#cntwingrp}>3

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top