Results 1 to 14 of 14
  1. #1
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10

    Question Question about report

    Hello, guys! Hows everyone?



    Lets assume I have this table:

    Code / Name / Color
    1 - Ana - Blue
    2 - Bruce - Black
    3 - Carlos - Red
    4 - Daniel - Blue


    1- How can I make a relatory only for people who had chose the color BLUE ?
    2- How can I make a realtory of how many people I have on the table?

    Thanks so much
    Last edited by June7; 04-12-2012 at 12:03 PM.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    1. Select * From YourTableName
    Where yourtablename.color = "Blue";

    2. Select Count(yourTableName.Name)As CountofName
    From YourTableName;

    As an aside, the word Name is a reserved word in Access and you should not use it as a field name. Name1 or LName would be preferred.

  3. #3
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    Quote Originally Posted by alansidman View Post
    1. Select * From YourTableName
    Where yourtablename.color = "Blue";

    2. Select Count(yourTableName.Name)As CountofName
    From YourTableName;

    As an aside, the word Name is a reserved word in Access and you should not use it as a field name. Name1 or LName would be preferred.
    Alan, I appreciate so much all the help. But where do write these codes? Ima kinda new to access.
    THanks so much

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You will need to put these in your queries as the SQL statement. Suggest you start by reading a tutorial on queries. Here is a starting point

    http://support.microsoft.com/kb/304361

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    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.

  6. #6
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    I appreciate so much, guys. Its kinda hard for me, because im extremely new to this program, and I need to do this by tomorrow. I'm gonna try!

  7. #7
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    Guys, I still cant use the codes.

    1- Trying to count how many people i have on the table.
    [Tabela de Professores] = My table
    Nome = Field that I want to count.

    So, this is how it appears here when I open in SQL mode:

    SELECT [Tabela de Professores].Nome, [Tabela de Professores].Pesquisas
    FROM [Tabela de Professores]
    GROUP BY [Tabela de Professores].Nome, [Tabela de Professores].[Pós Que Leciona:], [Tabela de Professores].Pesquisas
    ORDER BY [Tabela de Professores].[Pós Que Leciona:];

    So, Im tryng to use the code that Andy gave me:

    SELECT [Tabela de Professores].Nome, [Tabela de Professores].Pesquisas
    SELECT Count([Tabela de Professores].Nome)As CountofNome
    FROM [Tabela de Professores]
    GROUP BY [Tabela de Professores].Nome, [Tabela de Professores].[Pós Que Leciona:], [Tabela de Professores].Pesquisas
    ORDER BY [Tabela de Professores].[Pós Que Leciona:];




    When I try this, shows here: Syntax error on COUNT.

    What am i doing wrong?

  8. #8
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Look at the attached.
    Attached Files Attached Files

  9. #9
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    Quote Originally Posted by alansidman View Post
    Look at the attached.
    Alan, I got it. Appreciate so much all the help

    But I have a question.

    Now, I got the number that I was looking for, the number 4 (numbers of name on my query).
    So how can I use the result of this query (the number 4) on a relatory? I mean, how can I rescue this number to use it on my database ?

  10. #10
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    How do you want to use it? It is a calculated number that can be retrieved at any time. In your report, use the query as the recordset. If you need to use more than one query, then create a sub-report.

    Alan

  11. #11
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    I mean, I want to put on my Relatory omsething like this: "Numbers of people on my table: #NUMBER" (the #number is what the query will calculate, in your example, the name is CountOfName1).
    How can I do it? I just write =CountOfName1 on the text?

    Appreciate so much

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    What is a 'relatory' - please define what this means to you?

    As Alan, said, use the query as the RecordSoure for a report. Bind textboxes to fields of the query. This is basic Access functionality. I suggest you get an introductory book and work through tutorials.
    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.

  13. #13
    NoAlarms is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    10
    Quote Originally Posted by June7 View Post
    What is a 'relatory' - please define what this means to you?

    As Alan, said, use the query as the RecordSoure for a report. Bind textboxes to fields of the query. This is basic Access functionality. I suggest you get an introductory book and work through tutorials.
    I'm so sorry. Bad english issues. Relatory = Report.

    What I want to know is how I retrieve a query to use it on a REPORT. Thanks so much

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Build query with query designer. Save it. Set report RecordSource property to the query.

    As stated, this is very basic Access functionality. Access Help has guidelines as do elementary reference books.
    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.

Tags for this Thread

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