Results 1 to 5 of 5
  1. #1
    citygov is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    5

    Getting one account from 15,000

    Thanks in advance for reading this. I'm trying to convert my data manipulation environment from a Basic language programming world to MS Access 2007 wherever possible. Here is one problem that has me stumped, any help is appreciated.

    I have an excel sheet with 15,000 records. Each record contains four fields: Account, Name, Location, and Budget. Each account number will have at least 8 records, and for the most part all of the data for each record with that account will be identical. The field that really changes will be Budget - it will either read "True" or "False". However, that should only change when the account number changes. So, all 8 records for an account should either read "True" or "False" for Budget.

    What I'm trying to find are any account numbers where some of the values in the Budget field are different for a given account. For example, a good account might look like

    Account Name Location Budget
    10150 Smith Main Street False
    10150 Smith Main Street False
    10150 Smith Main Street False
    10150 Smith Main Street False
    ...


    10160 Jones First Street True
    10160 Jones First Street True
    10160 Jones First Street True
    10160 Jones First Street True
    ...
    An account I want to discover may look like this:
    Account Name Location Budget
    10150 Smith Main Street False
    10150 Smith Main Street False
    10150 Smith Main Street False
    10150 Smith Main Street False
    ...
    10160 Jones First Street True
    10160 Jones First Street False
    10160 Jones First Street True
    10160 Jones First Street True

    Account 10160 is what I would like to have reported back to me.

    In my old system I would have used an indexed file, stored all of the account numbers that had a True or False value, then compared it with the rest of the file. I'm not sure how to go about this in Access.

    Again, any advice is appreciated - thank you!
    Mike

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,933
    Don't quite understand your example. Are you showing only 4 of 8 lines for each of two account numbers? You don't want to return a 10150 line because they all show same Budget value (False). What if one was True?

    Have you imported this data to Access table? You can do same with Access queries.

    SELECT DISTINCT Table1.Account
    FROM (SELECT DISTINCT Table1.*
    FROM Table1) As Query1 RIGHT JOIN Table1 ON Query1.Account = Table1.Account
    WHERE (((Table1.Budget)<>[Query1]![Budget]));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    citygov is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    5
    Thanks for the reply. I haven't imported it into Access yet, but I will if I think I can make it work in Access. Yes, I am just showing 4 of the 8 records to save space. And yes, if an account number has both True AND False under Budget, I want to know which account it is. This worked very well, I hadn't even heard of the "Distinct"! Somehow, I have got to find a class that will teach me these advanced queries, but I'm in a small town in Minnesota with no education offerings, so I'm going to have to be creative. In the meantime, this goes in my file as a way to do these kinds of queries! Thanks again!
    Mike

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,933
    Check out tutorials at
    http://www.w3schools.com/sql
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    citygov is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    5
    Thanks to everyone for you help. And a big thank you to June7, that tutorial has been a lifesaver!
    Mike

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

Similar Threads

  1. Multiple account numbers
    By BenM912 in forum Forms
    Replies: 1
    Last Post: 03-21-2011, 10:47 AM
  2. Bank account catagories
    By broecher in forum Database Design
    Replies: 1
    Last Post: 10-16-2010, 10:21 PM
  3. Task Scheduler using Service Account
    By ExpertNovice in forum Access
    Replies: 2
    Last Post: 06-11-2010, 02:58 PM
  4. Newbie Help Account Numbers
    By Eric1066 in forum Access
    Replies: 3
    Last Post: 10-23-2009, 03:59 AM
  5. account rights
    By pietje in forum Security
    Replies: 1
    Last Post: 02-05-2009, 12:58 PM

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