Hi, I'm sure this is easy for someone.. I'm trying to create a report for a affiliate from my web site. He would like a monthly report to show what products he sold from his site.
I have two tables that this data resides on.
1) tblorderdetails
2) tblorders
in the tblorders there is a field AffiliateID, and OrderID
OrderID is the coralating field between the two tables
I tried this
select orderID, productname
from tblorderdetails where AffiliateID in (
select distinct OrderID from tblorders
where AffiliateID = '4'
)
Like I said the orderID is the same in both tables except that the AffiliateID resides in the tbleorders and pruductid resides on the other.
If you can Help I would Appreciate it.
Thanks in Advance
I'm using mysql and SQLyog as the front end.
Thanks
lee
I have two tables that this data resides on.
1) tblorderdetails
2) tblorders
in the tblorders there is a field AffiliateID, and OrderID
OrderID is the coralating field between the two tables
I tried this
select orderID, productname
from tblorderdetails where AffiliateID in (
select distinct OrderID from tblorders
where AffiliateID = '4'
)
Like I said the orderID is the same in both tables except that the AffiliateID resides in the tbleorders and pruductid resides on the other.
If you can Help I would Appreciate it.
Thanks in Advance
I'm using mysql and SQLyog as the front end.
Thanks
lee