I writing a query as follow - Select 'I87' [Location],PC.Company_Name [Company Name], Q.Department,PG.Group_Name [Group Name],
-
PS.SGroup_Name [Sub Group Name], PB.Item_Code[Item Code],PB.Item_Name [Item Name],
-
Sum(isnull(BD.Qty,0)) [Quantity], Sum(isnull(BM.Net_Amount,0))[Bill Amount] from I87.I87.Bill_Master BM
-
inner join I87.I87.Bill_Detail BD on BM.BillNoWPrefix=BD.BillNoWPrefix
-
inner join Packing_Belongs PB on PB.Item_Code=BD.Item_Code
-
inner join Prop_Company PC on PC.Company_ID=PB.Company_ID and PC.Company_ID='2'
-
inner Join PROP_Groups PG on PG.Group_Id=PB.Group_ID and PG.Group_Id='49'
-
inner join Prop_SGroup PS on PS.SGroup_Id=PB.SGroup_ID and PS.SGroup_Id='32'
-
inner join (Select Distinct Department from Packing_Belongs) Q on Q.Department=PB.Department and Q.Department='Bakery'
-
where BM.Bill_Date between '9/5/2011' and '9/20/2011'
-
group by PB.Item_Code,PB.Item_Name,PG.Group_Name,PS.SGroup_Name,Q.Department,PC.Company_Name
and its output is as follow..
Location , Company Name, Department, Group Name, Sub Group Name Item Code, Item Name, Quantity, Amount
But I required output as following format as shown in Image attached with this query..
can any one tell me how can I do so??
** Edit ** 1 1473 Rabbit 12,516
Recognized Expert Moderator MVP
You can use a pivot to get the values of a column across the top, but it only allows the use of one aggregate. I suppose you could use two pivots and then join them.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Derek Fountain |
last post by:
Just asked a question regarding this little bit of XSL:
---
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
...
|
by: bnp |
last post by:
Hi,
I took a test on C.
there was an objective question for program output type.
following is the program:
main()
{
char ch;
int i =2;
|
by: Aalok |
last post by:
This is what i want to do.
Read a text file as an input and based on that file, Create an outpu
text file which saves the contents of the input file in a specifi
format in the output file.
I...
|
by: Greenhorn |
last post by:
Hi,
when i run the output file generated by using cc i get no output on
my terminal.
#include <stdio.h>
main()
{
printf("Testing the printf functionality");
}
|
by: Nick |
last post by:
Hi,
Is it possible to pass execution to a view (aspx file), let it do its job,
and then capture the output? I want to achieve something like this during a
HttpRequest:
1. Invoke the...
| |
by: Umesh |
last post by:
/*program to search a* in a text file & write output in a file.*
indicated any character*/
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
FILE *f,*fp;
f=fopen("c:/1.txt","r");...
|
by: hpbrothers |
last post by:
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,i,j,k=0,fg=0;
for(i=0;i<5;i++)
{
cout<<"enter no.";
cin>>a;}
|
by: realmerl |
last post by:
Hi All.
I'm trying to transform a html document into plain text via xslt.
Simple you say! (i hope)
I have got it working, by using the magnificent <xsl:value-of select="."/>.
This returns the...
|
by: vijayarl |
last post by:
Hi Everyone,
i need to add a string in between the filename.so that new file will have the
required filename.
what am doing is reading the files from the directory & extract only the filename...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |