|
|

楼主 |
发表于 2005/9/7 16:17:29
|
显示全部楼层
SELECT C_BPartner.C_BPartner_ID, C_BPartner.Value, C_BPartner.Name,c.Name AS Contact,c.AD_User_ID,
C_BPartner.SO_CreditLimit-C_BPartner.SO_CreditUsed AS SO_CreditAvailable, C_BPartner.SO_CreditUsed,
c.Phone, a.Postal,l.C_BPartner_Location_ID, a.City, C_BPartner.TotalOpenBalance, C_BPartner.ActualLifetimeValue
FROM C_BPartner LEFT OUTER JOIN AD_User c ON (C_BPartner.C_BPartner_ID=c.C_BPartner_ID AND c.IsActive='Y')
LEFT OUTER JOIN C_BPartner_Location l ON (C_BPartner.C_BPartner_ID=l.C_BPartner_ID AND l.IsActive='Y')
LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID)
WHERE C_BPartner.IsSummary='N'
AND C_BPartner.IsActive='Y'
AND Sales Transaction='Y'
AND UPPER(C_BPartner.Name) LIKE ?
AND C_BPartner.IsVendor='Y'
AND C_BPartner.AD_Client_ID IN(1000000,0)
AND C_BPartner.AD_Org_ID IN(1000000,0)
ORDER BY C_BPartner.Value |
|