Results 1 to 6 of 6
  1. #1
    jsbdiver is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4

    Eliminate redundant data from Pick Box?

    Eliminate redundant data from Pick Box?
    Is there a way to limit the results of a query to only one of each item, removing the redundancy?


    Example: I have a DB with Addresses.
    I have a form with a pick box to select the State of residence, that opens a report with all the people living only in state X. The problem is, it lists the states for each entry in the DB so there are multiple TXs, multiple NMs …. For selecting which state to produce the report for, I would like it to list only one TX, one NM….. Is there an easy way to do this without creating a new table?

    Thanks
    jsbdiver

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    A group by on the state field should solve your problem.

    Click on the Sorting and Grouping icon on the toolbar.
    Now select your State field and turn group header on.

    Do a search for sorting and grouping for more info in this.

  3. #3
    Jim Doherty is offline Novice
    Windows XP Access 2000
    Join Date
    May 2010
    Location
    Derbyshire,England. UK
    Posts
    20
    Also Look at.... SELECT DISTINCT in SQL

  4. #4
    jsbdiver is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    Thanks, I’ll see what I can do this weekend.

  5. #5
    jsbdiver is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    The "SELECT DISTINCT" worked! Is there a good book that will help with the SQL commands? This was a simple fix, but I could not find much info in the Access help files.

    Thanks

  6. #6
    Jim Doherty is offline Novice
    Windows XP Access 2000
    Join Date
    May 2010
    Location
    Derbyshire,England. UK
    Posts
    20
    Quote Originally Posted by jsbdiver View Post
    The "SELECT DISTINCT" worked! Is there a good book that will help with the SQL commands? This was a simple fix, but I could not find much info in the Access help files.

    Thanks
    Playing around with the query wizard and looking look at its SQL generated in the SQL window will give you a start. Beyond that and to be frank there are tons of references on the internet on SQL and slowly but surely you will get the hang of things like SELECT, SELECT INTO, INSERT INTO, TRANSFORM and then correlated sub queries etc etc.

    The SELECT DISTINCT and SELECT DISTINCTROW predicates can easily be generated in Access when you look at the properties dialog of your query and pick 'unique records' or 'unique values' this syntax is generated for you.

    Any good book on Access generally has a good sampling of different query syntax including DDL derivates "CREATE TABLE", "ALTER TABLE", "ADD COLUMN" and so on

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Redundant data entry question
    By mathonix in forum Forms
    Replies: 3
    Last Post: 01-29-2010, 08:54 AM
  2. Using Redundant Tables
    By rand605 in forum Database Design
    Replies: 3
    Last Post: 12-03-2009, 09:38 AM
  3. Replies: 0
    Last Post: 05-16-2008, 07:50 AM
  4. Replies: 2
    Last Post: 04-17-2006, 08:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums