group to combine parameters

A

anil

I have following tables and query with example data
tblGroup - GroupID ,GroupName
1 , GTP1
2 , GTP2
tblParameter -ParameterID , ParameterName
1, BOD
2, pH
3, SS
4, TP
tblGroup_Par - Group_ParID, GroupId, ParameterID
1, GTP1, BOD
2, GTP1, SS
3, GTP1, pH
4, GTP2, BOD
5, GTP2, SS
6, GTP2, TP
qryWW - SampleID, SiteName,ParameterID.
101, TT1, BOD, SS, pH (in crosstab as example)
102, TT2, BOD, SS, TP

Now when I combine all these tables and query to get a group instead
of parameters as
101, TT1, GTP1
102, TT2, GTP2

it gives me result as
101,TT1,GTP1
101,TT1,GTP2
102,TT1,GTP1
102,TT1,GTP2

can someone please help me in getting the result proper.

Thanks
Anil
 
K

KARL DEWEY

Post the SQL of your query. Open the query in design view, click on menu VIEW
- SQL View. Highlight all, copy, and paste in a post.
 
A

anil

My query is
SELECT DISTINCT [TempqryWW GROUPS].Location, [TempqryWW
GROUPS].SiteCode, [TempqryWW GROUPS].WWMonth, [TempqryWW
GROUPS].WWYear, [TempqryWW GROUPS].SampleID, [TempqryWW
GROUPS].ParameterName, tblGroup.GroupName
FROM (tblGroup_Parameter INNER JOIN tblGroup ON
tblGroup_Parameter.GroupID = tblGroup.GroupID) INNER JOIN [TempqryWW
GROUPS] ON tblGroup_Parameter.ParameterID = [TempqryWW
GROUPS].ParameterId

Hope it helps
 

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


Top