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

Differences in a group 1

Status
Not open for further replies.

JustineB

Programmer
Mar 30, 2001
165
GB
I hope that someone may be able to help.

I have a table with an order number, line number and Status fields. Each order can have several lines and each line can have one of 6 Status's.

I need to write a simple report to find all orders with differing line Status's. Eg:

order_number: 000111
Line_number Status
001 3
002 1
003 3

Order_number: 000112
Line Number Status
001 1
002 3

An order with all lines with the sames status would not be displayed:

Order_number: 000110
Line Number Status
001 5
002 5
003 5

I have tried to use Previous and Next and have tried using subreports, but cannot seem to get it working. I have written a similar report (years ago) and know that it is possible, just can't seem to get my head around this one!

I am using a SQL Database with Crystal 8.5.

Many thanks in advance.

Justine.
 
You could do one of two things. Go to report->edit selection formula->GROUP and enter:

distinctcount({table.status},{table.orderno}) > 1

...where you have grouped on {table.orderno}.

Or, you could go to format->section->group header/details/group footer->suppress->x+2 and enter:

distinctcount({table.status},{table.orderno}) = 1

-LB
 
LB

Thanks so much for this, I knew that there must be a simple way of doing it, but wasn't aware that you could use 'selectdistinct' in Crystal.

A star for you for your easy and correct solution!

Justine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top