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

group selection help

Status
Not open for further replies.

jvolden

IS-IT--Management
Jan 26, 2005
77
US
I'm rather new to Crystal reports and could use a little help. I have made a group seletion based on serial numbers. It then displays all incident numbers related to the serial number. I want to know how I can omit a serial number if it has less than 2 incidents related to it. I have a count field but am unsure what to do next.
Thank you.
 
Use the count summary to compare to the number you want to see returned:

Report menu, Selections Formulas, Group:

Count({table.serial_number},{table.group_field}) >= 2

~Brian
 
Try this. Slick on Select Expert->Show Formula and click on Group Selection -> Formula Editor and enter the following formula

Code:
Count({Table.Incidents},{Table.Serial}) > 2


Substitute Count({Table.Incidents},{Table.Serial} with whatever group count you currently have.

Cheers,
-LW
 
Thank you, every thing is working great, almost. Now I have to figure out how to have it select only incident number that were opened within the last 30 days of the date the report is run. Any help would be great.
Thank you.

Also, are there any sites out there dedicated to the crystal syntax?
 
If you only want to select those groups that have at least two incidents within the last 30 days, then go to edit selection formula->RECORD and enter:

{table.date} > currentdate-30

And leave the group selection formula shown by Brian above.

If you want to show those groups whose most recent incident was within the last 30 days but with earlier incidents potentially earlier than that, then do not use the record selection formula and instead change the group selection to:

maximum({table.date},{table.groupfield}) > currentdate-30 and
count({table.incident},{table.groupfield}) >= 2

-LB
 
Works like a charm. Thank you for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top