Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 transact-sql code to display preformatted tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-03 : 08:44:08
altimebest1 writes "Please show sql codes to creating a table showing Value and quantity under a heading, the month the data was collected or the value and quantity in the 1st, 2nd, 3rd and 4th quarter values under a heading Year.
My source table is:
comCode char 7
monthCode char 2
year char 4
countryCode char 3
quantity int
value money
insurance money
freight money
i also have a lookup table for:

  
Commodities Countries
comCode char 7 countryCode char 3
comDescriptions varchar 255 countryName varchar 255


the format of the table i wish to create

Com Commodity Description Jan
Code Country of Destination Value Quantity


Thank you for helping me and I been a constant visitor to your site and it's wonderful and gives great help to sql enthusiasts."

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-03-03 : 09:42:46
You are trying to create a formatted report with TSQL. TSQL is designed for data manipulation, not formatting. You need to use a report generator such as Active Reports, Crystal Reports, or MS Access to format the output from your database server.
Go to Top of Page
   

- Advertisement -