473,666 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with pivot table

1 New Member
Hi!

I`ve been struggling to find a solution to make a report from MS SQL, and I think pivot table is the key but I`m not sure on how to do this. Hope someone can help, here is the case :

I have one table "Products" and one table "Packages". Every product in the Products table has 1 - * Packages (unit which the product is sold by)

The Products table looks something like this :

Id | productText | productGroup | etc

And the Packages table like this :

Id | productId | packageType | weight | etc

What I want to do is to flat this out so I can get the Product and all it`s packages in one record. Something like this :

productText | productGroup | packageType | weight | packageType | weight | etc.

I would really appriciate if someone could help me out with this.

Regards,
Knut
Nov 27 '07 #1
1 1133
debasisdas
8,127 Recognized Expert Expert
You need to use DECODE for the purpose.
Nov 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2099
by: Prasad Patil | last post by:
Hi, I have created a report in excel, it uses Pivot tables. The excel has two sheets 1: Pivot ( Contains the Pivot Table) 2: Data (Data Requred to populate the pivot table I create an instance of Excel populate the data sheet and load excel in the browser.
2
5830
by: Rob | last post by:
I'm just getting around to using pivot tables and charts. I find the Pivot table interface to be INCREDIBLY frustrating. When I view a table in Design view, then choose Pivot table view, I get the PivotTable Field list, from which I can choose to add fields to the view. 1. How do you get RID of a field once you put it in? I can not right click on anywhere in the view and have ANY of the submenu options be availble. From the PivotTable...
4
2854
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table query. I'm having trouble doing it. Help! Here is my code so far: Sub OldRegionQuery()
1
2720
by: SJM | last post by:
I have a reporting database that has a series of pre-defined Pivot Table screens. What I would like to do is to enable users to be able to save their own configurations. I found 2 ways of doing this. One involved saving the Pivot Table XML, which seemed a great concept but one which seemed ot only work on MS Access 2003 and not on Access 2002. The other method involved having code to save the Pivot Table as a new form, and populating a...
1
1903
by: jodyblau | last post by:
I am attempting to learn to use pivot tables. I have noticed that if I have used the Lookup Wizard when creating my tables so allow the user to select from a list of choices when entering data, this causes a problem with the pivot tables. When I try to use a field like "Customer_Name" and drag it onto my pivot table, it display's the ID for that Customer instead of the Customer's name.
9
6787
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury Bonds, the Prime rate, and so-forth. We associate a security with one of those rates. There are a set of rates for each calendar day, and the rates for that
8
5924
by: PhilBowen | last post by:
I have created a pivot table making reference to a query. It works perfectly well. However, when I go out of the database and then back in the pivot table appears as a "form". I can click on the "design" icon to change back to pivot table. It is however frustrating to have to do this each time. I have checked the properties and everyhting appears to reference to pivot table. Can you please advise what I need to do to see the pivot table each...
4
2149
bhcob1
by: bhcob1 | last post by:
Hi guys, I need to create a Pivot Table on my database, I don't know much about them. I want the user to be able to direct themselves from my main switchboard (via a cmd button) to the pivot table. Where is it best to create a pivot table VBA, Form, Page... I would like the Pivot Table to not save the users changes but instead open up as a defualt that i set. So I guess my question is, where is the best place to create a Pivot Table for...
1
1945
by: Adu | last post by:
Pivot Tables -------------------------------------------------------------------------------- Hi guys, I have two questions: First Question: I have created a Pivot Table on my Access database. I don't know much about them. However anytime I click the button on my form to view it. It gives me a form view results instead of Pivot Table view. I check the properties and it is set to Pivot Table. What should I do? The second question is...
0
1535
by: ravindarjobs | last post by:
Hello friends, I am using ms access 2003, and Vb6. i am displaying a table in a form as pivot table (following "Auto Form: Pivot Table" Wizard) Usually i select the items i want to be displayed in the pivot table by dragging them on to the pivot Table from Pivot Fields. But i got a Problem. My table wil have Columns Dynamically. i mean the colums may increase and decrease from time to time. so my requirement is to display the Updated...
0
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8876
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.