access grouping data back

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum 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

resolvedResolved · 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


 

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:

1. Open the Query in Design View
2. Select the field for the filter and in the criteria row enter:

<Date()

This filter returns records where the Invoice Date is before today's date.

This filter can be manipulated if, for instance, Invoices are due 15 days after the Invoice Date. For this the filter would be:

<Date()-15

This filter returns records where the Invoice Date is 15 days before today's date.

View all Access hints and tips


Server loaded in 0.1 secs.