Subject Data in Row Format, Need To Display In Columun Format
Author Vishal Tiwari
Hi All,
 
Sorry for all my prvious mails, i do not know why display is coming like that,
 
pl. find another mail.
 
I have a table named as "Book_Details", table structure is as follows:
 
sYear Varchar(4) Not Null,
sYearMonth Varchar(6) Not Null,
sBranchCode Varchar(15) Not Null,
sBook_Name Varchar(50) Not Null,
rBook_Price Numeric(15, 2) Not Null,
iCopy_Sold Integer Not Null,
rTot_Amount Numeric(15, 2) Not Null
Primary key (sYear, sYearMonth, sBranchCode, sBook_Name)
 
So Table with its value will look like:
 
Table Name : Book_Details
 
sYear  sYearMonth  sBranchCode  sBook_Name  rBook_Price  iCopy_Sold   Tot_Amount
2009   200912          BRANCH1      BOOK1          1500.00        50                75000.00
2009   200912          BRANCH2      BOOK1          1500.00        70              105000.00
2009   200912          BRANCH1      BOOK5          1000.00        50                50000.00
 
2010   201001          BRANCH1      BOOK1          2000.00        60              120000.00
2010   201001          BRANCH2      BOOK1          1200.00        50                60000.00
2010   201001          BRANCH1      BOOK5          1500.00        50                75000.00
 
 

End user could select any two YearMonths to see the differecnce.
 
I need to get display as follows:
 
sBranchCode  Book1_Price  Book1_Price  Difference      Difference in 
                     in 200912      in 201001     in Copy Sold   Tot_Amount
 
BRANCH1      1500.00         2000.00        10                  45000.00
BRANCH2      1500.00         1200.00        20                  45000.00

Continue....

  Book5_Price  Book5_Price  Difference      Difference in  
  in 200912      in 201001       in Copy Sold   Tot_Amount
 
  1000.00         1500.00        0                   25000.00
   0.00               0.00              0                   0.00
 
 
I need each book details in column format for respective branch.
 

I am still trying, but since the data available in the row format, I am strugling with the required result.
 
Thanks In Advance.
 
Vishal



[Non-text portions of this message have been removed]