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!

Need some help with data arrangement

Status
Not open for further replies.

stormtrooper

Programmer
Apr 2, 2001
266
CA
Hi there. I looked at one of the threads below that is similar to my problem, tried it, and to no avail.

Anyway, I have a database that looks like this:

PartNo Type Price Date Address ... etc.
1002 A 20 1/1/04 Here ...
1002 B 5 3/3/04 Here ...
.
.
.

What I want is for Crystal 9 to display this:

PartNo TypeA TypeB InitDt UpdtDt Address ... etc
1002 20 5 1/1/04 3/3/04 Here ...

Right now I'm in a middle of a mess of formulas and can only tell you that I have this grouped by PartNo.

Please advise, thanks.
 
Group by PartNo.
Place address in your group header section.
Place type field, date field in your detail section
Create a formula for counting the TypeA's
Code:
if {table.type} = "A" then
    1
else
    0
Place this in the details section.
Right click the new formula and choose Insert, Summary.
Choose sum and group 1 and click ok.
Move the field from your group footer to the group header.

Create a formula for counting the TypeB's
Code:
if {table.type} = "B" then
    1
else
    0
Place this in the details section.
Right click the new formula and choose Insert, Summary.
Choose sum and group 1 and click ok.
Move the field from your group footer to the group header.

Right click the date field in the detail section and choose INsert, Summary.
Choose min and group 1 and close.
Repeat the process for the same field, but choose max instead of min.
Move both fields to the group header.

Finally, suppress the detail section.

This should get you close except for the etc. stuff you left out.

~Brian
 
If you always ony have two records per part number, another approach would be to drag or copy the detail records into the group header and then create formulas using "next", as in:

next({table.date})//or

next({table.type})

Place these in the group header, and you will have the results from the first and second records displayed on one line.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top