Solved

MS Access query need help with statement in query  to remove data for certain criteria

Posted on 2016-11-02
6
48 Views
Last Modified: 2016-11-03
Hello - I have a question for the experts.

I have a field that I need to weed out some information in the query... either adding in VBA code or right in the query.



The field has 002, 003 and blanks for each encounter.

If the customer has a 002 for an encounter, then I need 002 to show
If the customer has 002 and a 003 for the encounter, I just want the 003 to show
If the customer is blank for the encounter then the blank field to show

I wrote this out in the example attached to clarify.  Thank you.
Sample_1.xlsx
0
Comment
Question by:joylene6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 

Expert Comment

by:Zahier Adams
ID: 41870569
hi sorry please clarify is it the f002 encounter?
0
 
LVL 1

Author Comment

by:joylene6
ID: 41870588
Hello-
    to clarify the encounter number is the encounter number field.   The numbers 002,003 and the blanks are in the number field.

I probably should have named them something completely different. I hope this helps. Thank you!
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 41870966
try this query

SELECT myTable.Customer, (select Max([Number]) From myTable as A where A.Customer=MyTable.Customer) AS Expr1
FROM myTable;
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 1

Author Comment

by:joylene6
ID: 41871184
Thank you Rey, I will have a chance to try this as soon as I get back to my computer.
0
 
LVL 1

Author Comment

by:joylene6
ID: 41872477
Thank you Rey! That worked. I did not even think about using MAX.
0
 
LVL 1

Author Comment

by:joylene6
ID: 41872479
Thank you Rey! That worked. I did not even think about using MAX.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question