Solved

SQL OR CRYSTAL HELP

Posted on 2014-12-23
6
197 Views
Last Modified: 2014-12-24
I'm trying to create a report that has a table that lists part numbers and a table that lists an attribute name and a third table that lists the attribute value.  There are up to 7 different attribute names but each part number usually has between zero and four attributes.  When I create a CR that shows the part number and the attribute name and value, a part that has four different attributes will show up four different times, one for each attribute.  I want to somehow display all attributes 1's in one column, 2's in a second column and so forth, with the part number listed only once.  The attributes have a UID (1-7) but they also have a name. Ultimately, I would like to create a new view for this as I seem to always need this info.  I'm not too familiar with SQL so don't really know how to do that.  How can I get this info all on one line in a report?
0
Comment
Question by:ITworks
6 Comments
 
LVL 17

Expert Comment

by:OriNetworks
ID: 40515236
While I do not fully understand what you are trying to accomplish it would help the community if you share the sql you have created so far and maybe a screenshot of the report layout you have created.

My first thought was that you may benefit from a subreport to show the attributes for each part but then you mentioned to have all of the attributes on one line which I do not understand.
0
 
LVL 18

Expert Comment

by:vasto
ID: 40515288
You need to use left join between the parts, attribute name and attribute value. This will create a view with all parts, attributes name and corresponding values (if any). Then use a Cross tab to place the parts and rows, attribute names as columns and attributes values as values
0
 
LVL 4

Author Comment

by:ITworks
ID: 40515391
Untitled.png
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 4

Author Comment

by:ITworks
ID: 40515394
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 40516306
I can think of a few ways to do something like that in CR.  How many UID's can there be for a "part"?  Is there a set limit of 7, or could there be more?  If there could be more, and you're not sure how many, then you may need a more sophisticated solution (like a cross-tab, like vasto suggested).

 If there is a set limit, you could try something like this.

 Using your sample report, with 4 formulas for UID's 1 - 4.  Group the report on whatever identifies a "part" (lot and item_id?), and suppress the detail section.  Put lot, item_id and item_desc in the group header or footer (your choice).  Right-click on each of your formulas in the detail section (eg. @COO) and select Insert > Summary, and create a Maximum summary for the "part" group (not a grand total).  Put those summary fields in your group header or footer with the other fields.

 I think that should work.

 James
0
 
LVL 4

Author Closing Comment

by:ITworks
ID: 40516733
That did it!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now