Click here to Skip to main content
15,923,845 members
Home / Discussions / Database
   

Database

 
GeneralRe: database location Pin
Jeff Varszegi13-May-04 14:54
professionalJeff Varszegi13-May-04 14:54 
GeneralRe: database location Pin
Anonymous13-May-04 15:41
Anonymous13-May-04 15:41 
GeneralRe: database location Pin
Jeff Varszegi15-May-04 2:43
professionalJeff Varszegi15-May-04 2:43 
GeneralRe: database location Pin
Anonymous15-May-04 4:17
Anonymous15-May-04 4:17 
QuestionImage problem??? Pin
Small Rat13-May-04 9:24
Small Rat13-May-04 9:24 
AnswerRe: Image problem??? Pin
Hesham Amin13-May-04 21:50
Hesham Amin13-May-04 21:50 
GeneralCross-tab query Pin
Ole12313-May-04 8:14
Ole12313-May-04 8:14 
GeneralRe: Cross-tab query Pin
-Dr_X-13-May-04 10:57
-Dr_X-13-May-04 10:57 
This is not a trivial task. If you are not up on T-SQL you may want to look at a alternative method.

I initially created a cursor to create the a SQL statements as follows. Example:
SELECT   tp.PropertyTestID, tp.PropertyTestGroupID, tp.PropertyTestName, 
	SUM(CASE WHEN S.SampleID = 122 THEN ResultDecimal ELSE NULL END) AS [N/A122 05/02/2004],  
	SUM(CASE WHEN S.SampleID = 109 THEN ResultDecimal ELSE NULL END) AS [N/A109 03/31/2004],  
	SUM(CASE WHEN S.SampleID = 108 THEN ResultDecimal ELSE NULL END) AS [N/A108 03/30/2004],  
	SUM(CASE WHEN S.SampleID = 107 THEN ResultDecimal ELSE NULL END) AS [N/A107 03/17/2004],  
	SUM(CASE WHEN S.SampleID = 106 THEN ResultDecimal ELSE NULL END) AS [N/A106 03/01/2004],  
	SUM(CASE WHEN S.SampleID = 105 THEN ResultDecimal ELSE NULL END) AS [N/A105 01/05/2004],  
	SUM(CASE WHEN S.SampleID = 104 THEN ResultDecimal ELSE NULL END) AS [N/A104 11/17/2003]
FROM     tblSamplesPropertyTest tp,    			
	tblSamplesSample s, 
         tblSamplesSampleResult sr, 
	tblSamplesCustomerProductReportPropertyTest prpt, 
	tblSamplesProductPropertyTest ppt 
WHERE    tp.PropertyTestID = ppt.PropertyTestID 
AND	ppt.PropertyTestID = prpt.PropertyTestID 
AND	sr.CustomerProductReportPropertyTestID = prpt.CustomerProductReportPropertyTestID 
AND	s.SampleID =* sr.SampleID 
AND 	s.SampleID in (122,109,108,107,106,105,104)
AND	tp.ResultTypeID = 1
AND	(tp.Deleted = 0 or tp.Deleted Is Null)
GROUP BY tp.PropertyTestID, tp.PropertyTestGroupID, tp.PropertyTestName
After creating the statement I executed exec(@SQL) in the procedure.

However, I found this site that was quite helpful. Once I figured out what the crosstab stored procedure was doing in the article. Now any new crosstab/pivot tables are created using this method.

http://www.sqlteam.com/item.asp?itemID=2955

The easiest route, but not the best, may be to create an ODBC link to SQL server. Create an access database that links the necessary tables for the reports. Then simply create the reports in Access.

Good Luck,
Michael


I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
GeneralRe: Cross-tab query Pin
Ole12314-May-04 8:18
Ole12314-May-04 8:18 
GeneralUDF and Table Column Formula Pin
Wackatronic13-May-04 7:06
Wackatronic13-May-04 7:06 
GeneralRe: UDF and Table Column Formula Pin
Grimolfr19-May-04 8:51
Grimolfr19-May-04 8:51 
GeneralData access problem Pin
damoonlight12-May-04 16:27
damoonlight12-May-04 16:27 
GeneralProblem in finding sum of Columns in a Table Pin
Touseef Afzal12-May-04 12:09
Touseef Afzal12-May-04 12:09 
GeneralRe: Problem in finding sum of Columns in a Table Pin
Edbert P12-May-04 12:45
Edbert P12-May-04 12:45 
GeneralRe: Problem in finding sum of Columns in a Table Pin
Touseef Afzal12-May-04 13:08
Touseef Afzal12-May-04 13:08 
GeneralDataGrid and SQLDataReader Pin
Xaneb12-May-04 9:16
Xaneb12-May-04 9:16 
GeneralRe: DataGrid and SQLDataReader Pin
-Dr_X-12-May-04 16:36
-Dr_X-12-May-04 16:36 
Generalcheck Box and sqlDataReader Pin
Xaneb13-May-04 0:59
Xaneb13-May-04 0:59 
GeneralRe: check Box and sqlDataReader Pin
-Dr_X-13-May-04 11:05
-Dr_X-13-May-04 11:05 
GeneralDetect new record entered/updated in MS SQL Pin
Vu Truong11-May-04 17:08
Vu Truong11-May-04 17:08 
GeneralRe: Detect new record entered/updated in MS SQL Pin
Ian Darling11-May-04 23:24
Ian Darling11-May-04 23:24 
GeneralRe: Detect new record entered/updated in MS SQL Pin
cmk13-May-04 10:53
cmk13-May-04 10:53 
GeneralcommandString Problem Pin
Anonymous11-May-04 12:52
Anonymous11-May-04 12:52 
GeneralRe: commandString Problem Pin
Edbert P11-May-04 16:49
Edbert P11-May-04 16:49 
GeneralRe: commandString Problem Pin
Aryadip12-May-04 0:09
Aryadip12-May-04 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.