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

Combining parts of two records into one detail line

Status
Not open for further replies.

Snakeroot

Technical User
Oct 4, 2006
112
0
0
US
CR XI (11.5.11.1470)
SQL Server 2008

I'm having a problem getting the exact result I'm looking for and could use some help.

I have 5 fields:
CSize, Serial, WO, RefT, Lbs

I have two types of records that are being displayed currently:
Cyl record and a Ref Record

This is the current output:
[tt]CSize Serial WO RefT Lbs[/tt]
[tt]3/5 100001 238T 1[/tt]
[tt]R-99 238T R-99 Desc 16[/tt]

I would like it to look like this:
[tt]CSize Serial WO RefT Lbs[/tt]
[tt]3/5 100001 238T R-99 Desc 16[/tt]

I was able to get the empty RefT field to display the value of the next record by using this formula and putting it in the RefT column in the details section:
Code:
 if next({Command.ItemRef_FullName}) LIKE 'Dynam%' then next({Command.CSize})

That gives me this output:
[tt]CSize Serial WO RefT Lbs[/tt]
[tt]3/5 100001 238T R-99 Desc 1[/tt]
[tt]R-99 238T 16[/tt]

I could do something similar for the Lbs column, but I'm stuck on how I would then get rid of the 2nd line displaying in my report. This one:

[tt]R-99 238T 16[/tt]

Can anyone help me out on this one? Thanks!


 
What fields are you grouping on? Are there more than these two records per group?

-LB
 
Grouping on a particular template, then on customer name, then on date of transaction, then on wo#

On this particular template type, there are only the two types of records that I indicated earlier.
 
Since WO# is your innermost group, I think you could just use a detail suppression formula like this:

{table.WO#} = previous({table.WO#})

-LB
 
Without trying it, wouldn't that give me every other work order rather than every other record in one work order?
 
No, it would suppress all but the first record associated with a particular wo#.

-LB
 
maybe, along with lbass' suppression of all but the 1st dteail, a formula like below for each 'next' detail value you need to show:

{@NextLB}
IF {Table.WO#}=NEXT({Table.WO#})
THEN NEXT({Table.Lbs}) else {Table.Lbs}

 
Sorry, I told you the wrong thing. The last group is actually by txnLineID, not WO#.

This is a new process and I can tweak the input of the data. I'm wondering if it would just make more sense to include the Serial on both entries during the data entry, then do a join in SQL using the matching serial# before the data is brought into Crystal?
 
agreed. if you can create a view in the database that contains your information as a single record that would be the best for data integrity as well as report performance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top