query/transform/crosstab??

  • Thread starter misschanda via AccessMonster.com
  • Start date
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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

cross tab query help 3
quey help please 6
Query Format Help 0
Query Speed/Indexes 6
DoCmd Transfer from ACCESS to Excel 1

Top