February 3, 2010 at 1:19 am
I have 2 tables Products and ProductSubGroup. I want to get the name of the sub group for the products that have '1' for the DocGroupID. I know the values are there, but I don't understand why I'm not getting the name from the other table. I have tried RIGHT OUTER JOIN, CROSS JOIN, INNER JOIN and variations of all. I have copied the query below. Any Help would be greatly appreciated. Thank you.
SELECT Products.DocSubGroupID, ProductSubGroup.SubGroupName
FROM Products LEFT OUTER JOIN
ProductSubGroup ON Products.DocSubGroupID = ProductSubGroup.id
WHERE (Products.DocGroupID = 1)
GroupID SubGroupName
13NULL
13NULL
13NULL
13NULL
13NULL
14NULL
14NULL
13NULL
13NULL
February 3, 2010 at 1:30 am
What results do you get from
Select * from ProductSubGroup where ProductSubGroup.id =13
February 3, 2010 at 1:42 am
Thank you. I am an idiot. I had my connection string pointing to the wrong database. can't retrieve the data if it's not there. DUH!!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply