98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Access Grouping data on the back of rules | Access forum
Access Grouping data on the back of rules | Access forum
Resolved · High Priority · Version 2007
Stephen has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access Grouping data on the back of rules
Hello, I am trying to write 3 queries that group certain data based on specific rules. I have a table of holdings. There are two types of holdings "Held" and "Not-Held". Each line of data has a client account number attached to it. The 3 queries are
1) query that will show me all the clients that only have "Held" posioions and no"Not Held" postions
2) All the clients that have "Not-Held" positions and no "Held" Postions.
3) All the clients that have both "Held" and "Not Held" postions
I have tried for 2 days without any luck
Thanks
RE: Access Grouping data on the back of rules
Hello Stephen,
Hope you enjoyed your Microsoft Access courses with Best STL.
Thank you for your question regarding creating queries.
If your 'Held' / 'Not Held' fields have a "Yes/No" data type then create the query to include whatever tables you need and add the relevant fields to the query design grid.
Client Account Number / Held / Not-Held
Query 1) In the criteria row type Yes for Held and No for Not-Held
Query 2) In the criteria row type No for Held and Yes for Not-Held
Query 3) In the criteria row type Yes for Held and Yes for Not-Held
Since I cannot see your database and don't know what the data type is for each field I'm not sure if this will work for you. If it doesn't work then you will have to provide me with more information.
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Rodney
Microsoft Office Specialist Trainer
RE: Access Grouping data on the back of rules
Managed to resolve it with the following SQL statement that one of our programmers helped me with 3 different versions of the below
WHERE (((Exists (SELECT 1 from Client_Data CD2, Holdings H2 where H2.SecuritiesHeld="Held" and CD.ClientGripsCode = CD2.ClientGripsCode and CD2.ClientGripsCode = H2.ClientGripsCode))<>False) AND ((H.SecuritiesHeld)="Not-Held"));
Thanks
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:How To Find All Overdue Accounts?To find overdue accounts create a filter that compares today's date with the Invoice Date in the table. To do this: |