troubleshooting Question

access 2007 distinct query problem

Avatar of sudif
sudifFlag for Bahrain asked on
Microsoft Access
2 Comments1 Solution1023 ViewsLast Modified:
I want the query to return unique values for the field T_Beneficiary.Ben_CPR I tried distinct and didn't make any change.
group by doesn't work
what is the ideal solution
PARAMETERS [from] DateTime, [to] DateTime, company Text ( 255 );
SELECT CPP_Company.Cpy_Name, CPP_Company.Cpy_Adress, CPP_Company.Cpy_Tel, CPP_Company.Cpy_Fax, T_Beneficiary.Ben_CPR, T_Beneficiary.Ben_Name, T_InitialActivity.Act_Route, T_InitialActivity.Act_DtePI, [T_PI-LPOCpy2].ID_PILPO, [T_PI-LPOCpy2].PI_LPO_No, T_Pay_PI.Pay_No, T_Pay_PI.Pay_Amt, T_Pay_PI.Pay_Dte
FROM (CPP_Company INNER JOIN ((T_Beneficiary INNER JOIN [T_PI-LPOCpy2] ON T_Beneficiary.Ben_ID = [T_PI-LPOCpy2].PI_BenID) INNER JOIN T_InitialActivity ON T_Beneficiary.Ben_ID = T_InitialActivity.Act_Ben) ON CPP_Company.Cpy_ID = T_Beneficiary.Ben_Cpy) INNER JOIN T_Pay_PI ON [T_PI-LPOCpy2].ID_PILPO = T_Pay_PI.Pay_LPO_ID
WHERE (((CPP_Company.Cpy_Name)=[company]) AND (([T_PI-LPOCpy2].PI_LPODte)<[to] And ([T_PI-LPOCpy2].PI_LPODte)>[from]))
ORDER BY [T_PI-LPOCpy2].PI_LPO_No, T_Pay_PI.Pay_No, T_Pay_PI.Pay_Amt;
ASKER CERTIFIED SOLUTION
kmslogic

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros