AllExperts > Using MS Access 
Search      
Using MS Access
Volunteer
Answers to thousands of questions
 Home · More Using MS Access Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scottgem
Expertise
I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience
I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > Access Help

Using MS Access - Access Help


Expert: Scottgem - 2/20/2005

Question
Hello, was wondering if you could help, The problem is very simple, I have a Simple table that I am using, one of the fields is called Indicator, there are only two possible values that are the Number 1 and Number 2. What I want to do is run a query (or something) that returns only the first record where the value in the Indicator field = 1, then all of the remaining records regardless of the value of field Indicator.
Thank you very much for your help.


Answer
Actually this isn't as simple as it seems. What you really need is three queries. First have a query that filters for Indicator = 1 and set to only show the TOP 1 value. Next you have a query that pulls all the other records but setting the criteria where the primary key is not equal to the key in the first query. Finally uou put them back together in a Union query, pulling the first query then the second.

HTH
Scott<>

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.