Results 1 to 4 of 4
  1. #1
    aubtiger14 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    10

    Creating a query

    Field1 Field2 Field3 Field4 Field5 Field6 Field7 Field8 Field9 Field10
    The Honorable Robert B. Aderholt
    2369 Rayburn House Office Building Washington DC 20515-0104 AL04
    The Honorable Robert E. Andrews
    2265 Rayburn House Office Building Washington DC 20515-3001 NJ01
    The Honorable Justin
    Amash
    114 Cannon House Office Building Washington DC 20515-2203 MI03
    The Honorable Mark E. Amodei
    222 Cannon House Office Building Washington DC 20515-2802 NV02
    The Honorable Spencer
    Bachus
    2246 Rayburn House Office Building Washington DC 20515-0106 AL06
    The Honorable Joe
    Barton
    2107 Rayburn House Office Building Washington DC 20515-4306 TX06
    The Honorable Xavier
    Becerra
    1226 Longworth House Office Building Washington DC 20515-0531 CA34
    The Honorable Sanford D. Bishop Jr. 2429 Rayburn House Office Building Washington DC 20515-1002 GA02
    The Honorable Earl
    Blumenauer
    1111 Longworth House Office Building Washington DC 20515-3703 OR03
    The Honorable John A. Boehner
    1011 Longworth House Office Building Washington DC 20515-3508 OH08
    The Honorable Kevin
    Brady
    301 Cannon House Office Building Washington DC 20515-4308 TX08
    The Honorable Corrine
    Brown


    2111 Rayburn House Office Building Washington DC 20515-0903 FL05
    The Honorable Robert A. Brady
    102 Cannon House Office Building Washington DC 20515-3801 PA01
    The Honorable Timothy H. Bishop
    306 Cannon House Office Building Washington DC 20515-3201 NY01
    The Honorable Marsha
    Blackburn
    217 Cannon House Office Building Washington DC 20515-4207 TN07
    The Honorable Madeleine Z. Bordallo
    2441 Rayburn House Office Building Washington DC 20515-5301 GU00
    The Honorable Michael C. Burgess
    2336 Rayburn House Office Building Washington DC 20515-4326 TX26
    The Honorable Rob
    Bishop
    123 Cannon House Office Building Washington DC 20515-4401 UT01
    The Honorable G. K. Butterfield
    2305 Rayburn House Office Building Washington DC 20515-3301 NC01
    The Honorable John
    Barrow
    2202 Rayburn House Office Building Washington DC 20515-1012 GA12
    The Honorable Charles W. Boustany Jr. 1431 Longworth House Office Building Washington DC 20515-1807 LA03
    The Honorable Michele
    Bachmann
    2417 Rayburn House Office Building Washington DC 20515-2306 MN06
    The Honorable Gus M. Bilirakis
    2313 Rayburn House Office Building Washington DC 20515-0909 FL12
    The Honorable Bruce L. Braley
    2263 Rayburn House Office Building Washington DC 20515-1501 IA01
    The Honorable Vern
    Buchanan
    2104 Rayburn House Office Building Washington DC 20515-0913 FL16
    The Honorable Paul C. Broun
    2437 Rayburn House Office Building Washington DC 20515-1009 GA10
    The Honorable Lou
    Barletta
    115 Cannon House Office Building Washington DC 20515-3811 PA11
    The Honorable Karen
    Bass
    408 Cannon House Office Building Washington DC 20515-0533 CA37
    The Honorable Dan
    Benishek
    514 Cannon House Office Building Washington DC 20515-2201 MI01
    The Honorable Diane
    Black
    1531 Longworth House Office Building Washington DC 20515-4206 TN06

  2. #2
    aubtiger14 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    10
    1. Create a query that displays just the representatives from Alabama, does NOT show the “Prefix”, but shows a count of them. Name the query “Alabama Query”.

  3. #3
    aubtiger14 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    10
    how do i do this?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Use Access query builder to build an aggregate Totals (GROUP BY) query. Access Help has guidelines. Basic Access functionality. The resulting sql statement will be like:

    SELECT Count(*) AS CountReps FROM table WHERE Left(Field10,2)="AL";

    If you want to show other info as well, that gets complicated:

    SELECT *, (SELECT Count(*) AS CR FROM table WHERE Left(Field10,2)="AL") AS CountReps FROM table WHERE Left(Field10,2)="AL";

    or

    SELECT *, DCount("*", "table", "Left(Field10,2)='AL'") AS CountReps FROM table WHERE Left(Field10,2)="AL";
    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.

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

Similar Threads

  1. Creating a query in VBA help?
    By offie in forum Programming
    Replies: 9
    Last Post: 07-15-2013, 01:54 PM
  2. Replies: 3
    Last Post: 01-01-2013, 06:22 PM
  3. need help with creating a certain query
    By tosho in forum Queries
    Replies: 4
    Last Post: 03-30-2012, 02:24 AM
  4. Creating a Dynamic Query
    By gdshih in forum Queries
    Replies: 4
    Last Post: 11-28-2011, 02:13 PM
  5. Creating a Query Need HELP
    By ampd in forum Queries
    Replies: 1
    Last Post: 02-16-2011, 12:12 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