M
misschanda via AccessMonster.com
I am trying to use a transform code to help allow me make a better crosstab
query
the squl is below.
i am having issues, cause it isn't grouping the sample numbers. I am having a
sample number repeated for each result, instead of having each sample number
and all the numericresults for each parameter in the heading.
any help thankful
currently looks like this
Sample id numeric results bromide chloride oxy etc
202 1.7 x
2003 1.3 x
2003 2.1 x
2003 5.1 x
It should be:
Sample id bromide chloride oxy etc
202 1.7
2003 5.1 1.3 2.1
TRANSFORM First(IIf([orderdetails.samplenumber] Is Null,"","X")) AS [the
value]
SELECT OrderDetails.samplenumber, Duke_Samples_Transformer.Manufacturer,
Duke_Samples_Transformer.TXSerialNumber, Results.NumericResult
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))
GROUP BY OrderDetails.samplenumber, Results.param, Duke_Samples_Transformer.
Manufacturer, Duke_Samples_Transformer.TXSerialNumber, Results.NumericResult
PIVOT Results.param;
query
the squl is below.
i am having issues, cause it isn't grouping the sample numbers. I am having a
sample number repeated for each result, instead of having each sample number
and all the numericresults for each parameter in the heading.
any help thankful
currently looks like this
Sample id numeric results bromide chloride oxy etc
202 1.7 x
2003 1.3 x
2003 2.1 x
2003 5.1 x
It should be:
Sample id bromide chloride oxy etc
202 1.7
2003 5.1 1.3 2.1
TRANSFORM First(IIf([orderdetails.samplenumber] Is Null,"","X")) AS [the
value]
SELECT OrderDetails.samplenumber, Duke_Samples_Transformer.Manufacturer,
Duke_Samples_Transformer.TXSerialNumber, Results.NumericResult
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))
GROUP BY OrderDetails.samplenumber, Results.param, Duke_Samples_Transformer.
Manufacturer, Duke_Samples_Transformer.TXSerialNumber, Results.NumericResult
PIVOT Results.param;