Calculation based on results of 2 expressions

Discussion in 'Microsoft Access Reports' started by MarthaNH, Apr 13, 2010.

  1. MarthaNH

    MarthaNH Guest

    I have a field called Reoffense Counter and a field called Counter, where
    Counter is the total count of all the records, and Reoffense Counter is the
    total of only those records where a new offense has taken place. Each of
    these fields contains a "1" where appropriate, so they can be counted. I
    want to find out what percentage of the records contain a Reoffense, so I
    think I would want to divide Reoffense Counter by Counter. I haven't been
    able to come up with the correct expression to use in my report. Can you
    help?
     
    MarthaNH, Apr 13, 2010
    #1
    1. Advertisements

  2. MarthaNH

    KARL DEWEY Guest

    In this query use your table and field names --
    SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
    FROM YourTable;
    --
    Build a little, test a little.


    "MarthaNH" wrote:

    > I have a field called Reoffense Counter and a field called Counter, where
    > Counter is the total count of all the records, and Reoffense Counter is the
    > total of only those records where a new offense has taken place. Each of
    > these fields contains a "1" where appropriate, so they can be counted. I
    > want to find out what percentage of the records contain a Reoffense, so I
    > think I would want to divide Reoffense Counter by Counter. I haven't been
    > able to come up with the correct expression to use in my report. Can you
    > help?
     
    KARL DEWEY, Apr 13, 2010
    #2
    1. Advertisements

  3. MarthaNH

    MarthaNH Guest

    Thank you, Karl. I tried entering this as a query and I also tried inserting
    it into a text box as an expression in the report, but I keep getting a
    Syntax Error. Perhaps there is something missing that my inexperience
    doesn't make clear to me?

    "KARL DEWEY" wrote:

    > In this query use your table and field names --
    > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
    > FROM YourTable;
    > --
    > Build a little, test a little.
    >
    >
    > "MarthaNH" wrote:
    >
    > > I have a field called Reoffense Counter and a field called Counter, where
    > > Counter is the total count of all the records, and Reoffense Counter is the
    > > total of only those records where a new offense has taken place. Each of
    > > these fields contains a "1" where appropriate, so they can be counted. I
    > > want to find out what percentage of the records contain a Reoffense, so I
    > > think I would want to divide Reoffense Counter by Counter. I haven't been
    > > able to come up with the correct expression to use in my report. Can you
    > > help?
     
    MarthaNH, Apr 13, 2010
    #3
  4. MarthaNH

    KARL DEWEY Guest

    In query design view use this as a calculated field --
    Re-offend Percent: Sum([Reoffense Counter]) / Sum([Counter]) * 100

    --
    Build a little, test a little.


    "MarthaNH" wrote:

    > Thank you, Karl. I tried entering this as a query and I also tried inserting
    > it into a text box as an expression in the report, but I keep getting a
    > Syntax Error. Perhaps there is something missing that my inexperience
    > doesn't make clear to me?
    >
    > "KARL DEWEY" wrote:
    >
    > > In this query use your table and field names --
    > > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
    > > FROM YourTable;
    > > --
    > > Build a little, test a little.
    > >
    > >
    > > "MarthaNH" wrote:
    > >
    > > > I have a field called Reoffense Counter and a field called Counter, where
    > > > Counter is the total count of all the records, and Reoffense Counter is the
    > > > total of only those records where a new offense has taken place. Each of
    > > > these fields contains a "1" where appropriate, so they can be counted. I
    > > > want to find out what percentage of the records contain a Reoffense, so I
    > > > think I would want to divide Reoffense Counter by Counter. I haven't been
    > > > able to come up with the correct expression to use in my report. Can you
    > > > help?
     
    KARL DEWEY, Apr 13, 2010
    #4
  5. MarthaNH

    MarthaNH Guest

    For some reason, I keep getting error messages. I'm probably trying to enter
    the expression in the wrong place. In query design view, is this expression
    placed in the "Field" row or in the "Criteria" row? Thank you for your
    patience.

    "KARL DEWEY" wrote:

    > In query design view use this as a calculated field --
    > Re-offend Percent: Sum([Reoffense Counter]) / Sum([Counter]) * 100
    >
    > --
    > Build a little, test a little.
    >
    >
    > "MarthaNH" wrote:
    >
    > > Thank you, Karl. I tried entering this as a query and I also tried inserting
    > > it into a text box as an expression in the report, but I keep getting a
    > > Syntax Error. Perhaps there is something missing that my inexperience
    > > doesn't make clear to me?
    > >
    > > "KARL DEWEY" wrote:
    > >
    > > > In this query use your table and field names --
    > > > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
    > > > FROM YourTable;
    > > > --
    > > > Build a little, test a little.
    > > >
    > > >
    > > > "MarthaNH" wrote:
    > > >
    > > > > I have a field called Reoffense Counter and a field called Counter, where
    > > > > Counter is the total count of all the records, and Reoffense Counter is the
    > > > > total of only those records where a new offense has taken place. Each of
    > > > > these fields contains a "1" where appropriate, so they can be counted. I
    > > > > want to find out what percentage of the records contain a Reoffense, so I
    > > > > think I would want to divide Reoffense Counter by Counter. I haven't been
    > > > > able to come up with the correct expression to use in my report. Can you
    > > > > help?
     
    MarthaNH, Apr 14, 2010
    #5
  6. MarthaNH

    MarthaNH Guest

    Karl - Please disregard my previous message. I'm not sure what I was doing
    wrong yesterday, but I went back and created the calculated field in the
    report design view, and it works now. Thanks so much for all your help!

    "MarthaNH" wrote:

    > For some reason, I keep getting error messages. I'm probably trying to enter
    > the expression in the wrong place. In query design view, is this expression
    > placed in the "Field" row or in the "Criteria" row? Thank you for your
    > patience.
    >
    > "KARL DEWEY" wrote:
    >
    > > In query design view use this as a calculated field --
    > > Re-offend Percent: Sum([Reoffense Counter]) / Sum([Counter]) * 100
    > >
    > > --
    > > Build a little, test a little.
    > >
    > >
    > > "MarthaNH" wrote:
    > >
    > > > Thank you, Karl. I tried entering this as a query and I also tried inserting
    > > > it into a text box as an expression in the report, but I keep getting a
    > > > Syntax Error. Perhaps there is something missing that my inexperience
    > > > doesn't make clear to me?
    > > >
    > > > "KARL DEWEY" wrote:
    > > >
    > > > > In this query use your table and field names --
    > > > > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
    > > > > FROM YourTable;
    > > > > --
    > > > > Build a little, test a little.
    > > > >
    > > > >
    > > > > "MarthaNH" wrote:
    > > > >
    > > > > > I have a field called Reoffense Counter and a field called Counter, where
    > > > > > Counter is the total count of all the records, and Reoffense Counter is the
    > > > > > total of only those records where a new offense has taken place. Each of
    > > > > > these fields contains a "1" where appropriate, so they can be counted. I
    > > > > > want to find out what percentage of the records contain a Reoffense, so I
    > > > > > think I would want to divide Reoffense Counter by Counter. I haven't been
    > > > > > able to come up with the correct expression to use in my report. Can you
    > > > > > help?
     
    MarthaNH, Apr 14, 2010
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darilyn

    calculation based on previous record

    Darilyn, Jul 25, 2003, in forum: Microsoft Access Reports
    Replies:
    0
    Views:
    516
    Darilyn
    Jul 25, 2003
  2. Guest

    Performing a calculation based on a field value

    Guest, Dec 1, 2004, in forum: Microsoft Access Reports
    Replies:
    1
    Views:
    151
    Marshall Barton
    Dec 1, 2004
  3. Guest

    Running sum based on Calculation

    Guest, Aug 4, 2005, in forum: Microsoft Access Reports
    Replies:
    1
    Views:
    185
    Guest
    Aug 5, 2005
  4. Guest

    Identifying number results in expressions

    Guest, Aug 19, 2005, in forum: Microsoft Access Reports
    Replies:
    7
    Views:
    140
    Marshall Barton
    Aug 20, 2005
  5. SusanP

    Create a calculation based on field in the previous record

    SusanP, Nov 9, 2006, in forum: Microsoft Access Reports
    Replies:
    4
    Views:
    242
    SusanP via AccessMonster.com
    Nov 13, 2006
Loading...

Share This Page