PC Review


Reply
Thread Tools Rate Thread

Calculation based on results of 2 expressions

 
 
MarthaNH
Guest
Posts: n/a
 
      13th Apr 2010
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?
 
Reply With Quote
 
 
 
 
KARL DEWEY
Guest
Posts: n/a
 
      13th Apr 2010
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?

 
Reply With Quote
 
 
 
 
MarthaNH
Guest
Posts: n/a
 
      13th Apr 2010
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?

 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      13th Apr 2010
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?

 
Reply With Quote
 
MarthaNH
Guest
Posts: n/a
 
      14th Apr 2010
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?

 
Reply With Quote
 
MarthaNH
Guest
Posts: n/a
 
      14th Apr 2010
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function isn't available in expressions in query expressions - hel =?Utf-8?B?SWNtZWxlcg==?= Microsoft Access 3 30th Jan 2008 10:33 PM
Results based on 2 expressions =?Utf-8?B?ams=?= Microsoft Access Queries 3 23rd Feb 2007 10:18 PM
Help With Expressions Within Expressions =?Utf-8?B?SGVsbG9Xb3JsZA==?= Microsoft Access Queries 2 15th Feb 2006 09:50 PM
Add custom regular expressions to the validation list of available expressions Jay Douglas Microsoft Dot NET Framework 0 16th Aug 2003 12:25 AM
Add custom regular expressions to the validation list of available expressions Jay Douglas Microsoft ASP .NET 0 15th Aug 2003 11:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 PM.