Results 1 to 5 of 5
  1. #1
    shenberry is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    4

    need Code

    Gosh it has been awhile, but I think I need a code to generate a special report. I have the database setup, with relationships. With these relationship I have generated a query. Now I need specific information to be output as a filter. Now I would like for this query/report/filter to auto update, if possible.



    I need to know how many students a teacher has sent to the office. So I have query Teacher Name as well I have Student Name. Now lets say 1 teacher sent the same child to the office, I still want that to be 1. So Teacher: Williams Referral: 1.

    It simple but I forgot what to use, as well I was doing this back in 2000, and now it is 2010.

    The code doesn't need to duplicate when it gets the same string combination for first and last name (two separate fields), pertaining to a particular teacher; will use students ids later when I get them.

  2. #2
    shenberry is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    4
    example of what I need
    Data Query
    Last Name
    First Name Teacher Name
    London Wil Alexander
    London Wil Alexander
    London
    Wil Alexander
    London Wil Alexander
    Jordan Ty Bates
    Hub
    Nigel Bates
    Jordan Ty Bates
    Jordan Ty Bates
    Green Green Bates
    Curry Shayne Bates
    Derange Isiah Bates
    Tarregano Rob
    Bates
    Green
    Green
    Bates

    Alexander = 1
    Bates = 6

    Thanks and it has been a while so please be a dear and simplify it as much as possible.

  3. #3
    shenberry is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    4
    okay I set up a query that just gave me the max per teacher, but the max or not accurate, because it contains duplicates, as well this might be a question for query and not programming, but I will let a mod decide that one.

    So Count of Students: Count(*)
    Expression

    Yields 4 instead of 1, but atleast I converted that data into a number. how can I convert a query to not pick up duplicates?

  4. #4
    LillMcGill is offline Dagny fan
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    Group by teacher
    Count student

  5. #5
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You could also try using

    SELECT DISTINCT ............

    then doing the count .......

    Just a thought...

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

Similar Threads

  1. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 AM
  2. Code help
    By Alex Motilal in forum Forms
    Replies: 3
    Last Post: 06-17-2010, 07:12 AM
  3. Help with code
    By steve183 in forum Programming
    Replies: 2
    Last Post: 06-04-2010, 05:14 PM
  4. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM
  5. Need help with code
    By hoenheim in forum Programming
    Replies: 9
    Last Post: 09-11-2008, 04:19 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