M
misschanda via AccessMonster.com
Hello,
I am trying to make a crosstab query , in which the parameters are listed as
column headings and the results are beneath for each sample.
So for instance if there were three different parameters for sample one it
would be:
Sample 1 Height Weight Location
5,11 215 Alabama
5,4 105 Alaska
6,1 245 Florida
It would not repeat the sample number or list the results next to parameter
The following is the current sql for what I have tried.
Any help is appreciated
Thanks,
SELECT DISTINCT Duke_Samples_Transformer.Manufacturer,
Duke_Samples_Transformer.TXSerialNumber, OrderDetails.SampleNumber, Orders.
OrderID, OrderDetails.CustomerSampleNumber, OrderDetails.CollectDate, Results.
ApprovedDate, Duke_Samples_Transformer.Temperature, Duke_Samples_Transformer.
Port, Duke_Samples_Transformer.WorkOrder, Results.Test, Results.Param,
Results.Result, Results.Units, Results.ResultStatus
FROM (((Orders INNER JOIN OrderDetails ON Orders.OrderID=OrderDetails.OrderID)
INNER JOIN SampleDetails ON (OrderDetails.SampleNumber=SampleDetails.
SampleNumber) AND (OrderDetails.OrderID=SampleDetails.OrderID)) INNER JOIN
Results ON (SampleDetails.Test=Results.Test) AND (SampleDetails.
SampleNumber=Results.SampleNumber) AND (SampleDetails.OrderID=Results.OrderID)
) INNER JOIN Duke_Samples_Transformer ON (Results.
SampleNumber=Duke_Samples_Transformer.SampleNumber) AND (Results.
OrderID=Duke_Samples_Transformer.OrderID)
WHERE (((OrderDetails.OrderDetails_User4) Is Null) AND ((OrderDetails.
SampleNumber) Not In (SELECT DISTINCT Results.SampleNumber FROM Results WHERE
Results.ResultStatus < 3))
ORDER BY OrderDetails.SampleNumber, Orders.OrderID;
I am trying to make a crosstab query , in which the parameters are listed as
column headings and the results are beneath for each sample.
So for instance if there were three different parameters for sample one it
would be:
Sample 1 Height Weight Location
5,11 215 Alabama
5,4 105 Alaska
6,1 245 Florida
It would not repeat the sample number or list the results next to parameter
The following is the current sql for what I have tried.
Any help is appreciated
Thanks,
SELECT DISTINCT Duke_Samples_Transformer.Manufacturer,
Duke_Samples_Transformer.TXSerialNumber, OrderDetails.SampleNumber, Orders.
OrderID, OrderDetails.CustomerSampleNumber, OrderDetails.CollectDate, Results.
ApprovedDate, Duke_Samples_Transformer.Temperature, Duke_Samples_Transformer.
Port, Duke_Samples_Transformer.WorkOrder, Results.Test, Results.Param,
Results.Result, Results.Units, Results.ResultStatus
FROM (((Orders INNER JOIN OrderDetails ON Orders.OrderID=OrderDetails.OrderID)
INNER JOIN SampleDetails ON (OrderDetails.SampleNumber=SampleDetails.
SampleNumber) AND (OrderDetails.OrderID=SampleDetails.OrderID)) INNER JOIN
Results ON (SampleDetails.Test=Results.Test) AND (SampleDetails.
SampleNumber=Results.SampleNumber) AND (SampleDetails.OrderID=Results.OrderID)
) INNER JOIN Duke_Samples_Transformer ON (Results.
SampleNumber=Duke_Samples_Transformer.SampleNumber) AND (Results.
OrderID=Duke_Samples_Transformer.OrderID)
WHERE (((OrderDetails.OrderDetails_User4) Is Null) AND ((OrderDetails.
SampleNumber) Not In (SELECT DISTINCT Results.SampleNumber FROM Results WHERE
Results.ResultStatus < 3))
ORDER BY OrderDetails.SampleNumber, Orders.OrderID;