SELECT PRODUCTMASTER.PRODTNAME,
PRODUCTMASTER.COMPANYCODE,
MEMBERSHIP.MEMBERSTARTDATE,
MEMBERSHIP.MEMBEREXPIREDATE,
MEMBERSHIP.MEMBERPOINT,
MEMBERSHIP.MEMBERPRENAME,
MEMBERSHIP.MEMBERNAME,
MEMBERSHIP.MEMBERSURNAME,
MEMBERHISTORY.MEMBERCODE,
DIVISION.NAME AS DIVISIONNAME,
INVOICEMASTERPOS.INVDIVISION,
INVOICEDETAILPOS.PRODCODE,
INVOICEDETAILPOS.PRODQTY
FROM MEMBERHISTORY,
MEMBERSHIP,
INVOICEMASTERDETAILPOS,
INVOICEDETAILPOS,
INVOICEMASTERPOS,
PRODUCTMASTER,
DIVISION
WHERE MEMBERHISTORY.MEMBERCODE=MEMBERSHIP.MEMBERCODE
AND
INVOICEMASTERPOS.INVDIVISION=DIVISION.CODE
AND
MEMBERHISTORY.REFERTAXINV=INVOICEMASTERPOS.INVDOCNO
AND
INVOICEDETAILPOS.DETAILID=INVOICEMASTERDETAILPOS.DETAILID
AND
INVOICEDETAILPOS.PRODCODE=PRODUCTMASTER.PRODCODE
AND
INVOICEMASTERPOS.INVMASTERID=INVOICEMASTERDETAILPOS.INVMASTERID
AND
MEMBERSHIP.COMPANYCODE = INVOICEMASTERPOS.COMPANYCODE
AND
MEMBERSHIP.COMPANYCODE = DIVISION.COMPANYCODE
AND
MEMBERSHIP.COMPANYCODE = PRODUCTMASTER.COMPANYCODE AND PRODUCTMASTER.COMPANYCODE = 'COFFMANCOFFEE'
Tag : ASP.NET MySQL, Ms SQL Server 2005, C#, Windows