C
Cathleen
I am attempting to create a crosstab query that would give me an output like
this:
event_id top_depth_zooplankton Species1 Species2
Species3
1 0 P. truncatum
K. longispina D. rosea
I assume I need a crosstab to achieve this from the following query (which
works well) that shows the three most abundant zooplankton species at each
depth for each "sampling event". This query's output looks like:
event_id top_depth_zooplankton density_zooplankton zooplankton_taxon
Here's the SQL:
SELECT Zooplankton.event_id, Zooplankton.top_depth_zooplankton,
Zooplankton.density_zooplankton, ZoopLookup.zooplankton_taxon
FROM ZoopLookup INNER JOIN Zooplankton ON ZoopLookup.zooplookup_id =
Zooplankton.zooplookup_id
WHERE (((Zooplankton.density_zooplankton) In (Select Top 3
[density_zooplankton] FROM Zooplankton As Dupe WHERE Dupe.event_id =
Zooplankton.event_id AND Dupe.top_depth_zooplankton =
Zooplankton.top_depth_zooplankton)) AND
((Zooplankton.sample_type_zooplankton)="FP"))
ORDER BY Zooplankton.event_id, Zooplankton.top_depth_zooplankton,
Zooplankton.density_zooplankton DESC;
Does anyone have any suggestions on how to get to the output I'd like? All
my attempts at basing a crosstab query on the above query have ended with an
error saying Microsoft Jet database engine can't recogize
Zooplankton.event_id (there are no parameters for this field).
Any help would be greatly appreciated.
Thank you!
this:
event_id top_depth_zooplankton Species1 Species2
Species3
1 0 P. truncatum
K. longispina D. rosea
I assume I need a crosstab to achieve this from the following query (which
works well) that shows the three most abundant zooplankton species at each
depth for each "sampling event". This query's output looks like:
event_id top_depth_zooplankton density_zooplankton zooplankton_taxon
Here's the SQL:
SELECT Zooplankton.event_id, Zooplankton.top_depth_zooplankton,
Zooplankton.density_zooplankton, ZoopLookup.zooplankton_taxon
FROM ZoopLookup INNER JOIN Zooplankton ON ZoopLookup.zooplookup_id =
Zooplankton.zooplookup_id
WHERE (((Zooplankton.density_zooplankton) In (Select Top 3
[density_zooplankton] FROM Zooplankton As Dupe WHERE Dupe.event_id =
Zooplankton.event_id AND Dupe.top_depth_zooplankton =
Zooplankton.top_depth_zooplankton)) AND
((Zooplankton.sample_type_zooplankton)="FP"))
ORDER BY Zooplankton.event_id, Zooplankton.top_depth_zooplankton,
Zooplankton.density_zooplankton DESC;
Does anyone have any suggestions on how to get to the output I'd like? All
my attempts at basing a crosstab query on the above query have ended with an
error saying Microsoft Jet database engine can't recogize
Zooplankton.event_id (there are no parameters for this field).
Any help would be greatly appreciated.
Thank you!