Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join two queries HELP PLEASE

Status
Not open for further replies.

jeffsui

Programmer
Oct 17, 2001
2
US
Ok I have two queries I want to join and am a little confused.

Query#1:
Code:
(Select * From LanguageSupport WHERE PID=3)

Output #1:
PID LID
----------- -----------
3 44
3 45
3 46
3 47
3 49
3 50
3 51
3 52

8 Row(s) affected

Query #2:
Code:
(SELECT Count(LanguageSupport.PID), LanguageSupport.PID
FROM Languages, LanguageSupport, Products
WHERE ((LanguageSupport.PID = 3) AND (LanguageSupport.LID = Languages.LID))
AND (Products.PID=3)
Group by LanguageSupport.PID)
Output#2:
Expr1000 PID
----------- -----------
8 3


Waht i'm looking for is something that looks like this
PID LID Somethign
----------- ----------- -----------
3 44 8
3 45 8
3 46 8
3 47 8
3 49 8
3 50 8
3 51 8
3 52 8

I want to do this with alot of records but for test purposes i just selected PID=3 -

Each PID (Product id) is attached to various LID (Langauge ID's) so i wanted to make a chart of PID,LID,(total number of LID's per product)

so any help please - i hope this is enough information. I need the count fucntion because i'm trying to loop through the record set and display something in html like

product - language,language,lanugage,language
product - language,language,langauge,language

so i figured i'd pull out the count(pid) from each record and loop through that many records forwards MoveNext() grabbing the LID then when i was done i'd pull a pid again

:)

I've tried various join's but i keep getting error messsages.

thanks for any help y'all can give!

-jeff
 
Have you tried saving the query with just the count and then using the design view put your product table and your count query in a new query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top