473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Calculated field question????

Hello:
Thanks for reading this post.

I need to create a metrics (form or report - I don't care which) to
display calculated fields about the database (A2002 front end to SQL
Server 2K)

1) I can't seem to enter SQL straight into the control

2) I tried entering things like (in the control) =COUNT([STDVerifyBy] =
'Test') --- and other variants.... with no results
So, Question. Can you build a calculated control on a form or report
that will let you gather and display statistics like....

- count of all records where STDVerifyBy equals "Test"
- count of all records where TesterID is NOT NULL
etc., etc., etc.
No real database info to be displayed, just a page of metrics data
gathered from querying the db.

Any ideas would be greatly appreciated....

Richard Hollingsworth

Nov 12 '05 #1
5 2910

Seems a fairly straight forward question, however I may have misinterpreted it.

countif, and sumif are probably what you are looking for.
this should be in the "Control Source" property of the field.
Countif works along the lines of:
=countif([primarykey],"([STDVerifyBy] = 'Test')")
Sumif works along the same lines.

You can't put these in the PAGE footer, only in the report footer, or other footers. I think if you put it in the detail, you will get a count of either 1 or 0 depending on whether the particular detail record meets the criteria.

Hope that helps!

Regards,

Fraser.

Richard Holliingsworth <wi*********************@boeing.com> wrote:
Hello:
Thanks for reading this post.

I need to create a metrics (form or report - I don't care which) to
display calculated fields about the database (A2002 front end to SQL
Server 2K)

1) I can't seem to enter SQL straight into the control

2) I tried entering things like (in the control) =COUNT([STDVerifyBy] =
'Test') --- and other variants.... with no results
So, Question. Can you build a calculated control on a form or report
that will let you gather and display statistics like....

- count of all records where STDVerifyBy equals "Test"
- count of all records where TesterID is NOT NULL
etc., etc., etc.
No real database info to be displayed, just a page of metrics data
gathered from querying the db.

Any ideas would be greatly appreciated....

Richard Hollingsworth


Nov 12 '05 #2
I believe that CountIf and SumIf are Excel functions. Check out DCount and
DSum, I believe they will do what you want.

--
Wayne Morgan
MS Access MVP
"Richard Holliingsworth" <wi*********************@boeing.com> wrote in
message news:Hs********@news.boeing.com...
Hello:
Thanks for reading this post.

I need to create a metrics (form or report - I don't care which) to
display calculated fields about the database (A2002 front end to SQL
Server 2K)

1) I can't seem to enter SQL straight into the control

2) I tried entering things like (in the control) =COUNT([STDVerifyBy] =
'Test') --- and other variants.... with no results
So, Question. Can you build a calculated control on a form or report
that will let you gather and display statistics like....

- count of all records where STDVerifyBy equals "Test"
- count of all records where TesterID is NOT NULL
etc., etc., etc.
No real database info to be displayed, just a page of metrics data
gathered from querying the db.

Any ideas would be greatly appreciated....

Richard Hollingsworth

Nov 12 '05 #3
Hi folks.

Thanks for the help, but I can't seem to find either set of commands in
the Access 2K help file. Where should I look for these commands????
Thanks,
Richard H

Wayne Morgan wrote:
I believe that CountIf and SumIf are Excel functions. Check out DCount and
DSum, I believe they will do what you want.


Nov 12 '05 #4
You will find them in the VBA help file. You have to open a code window
(Alt+F11) then open help.

Here are a couple of short excerpts from the help file:

You can use the DCount function to determine the number of records that are
in a specified set of records (a domain). Use the DCount function in Visual
Basic, a macro, a query expression, or a calculated control.

For example, you could use the DCount function in a module to return the
number of records in an Orders table that correspond to orders placed on a
particular date.

DCount(expr, domain, [criteria])
You can use the DSum functions to calculate the sum of a set of values in a
specified set of records (a domain). Use the DSum function in Visual Basic,
a macro, a query expression, or a calculated control.

For example, you could use the DSum function in a calculated field
expression in a query to calculate the total sales made by a particular
employee over a period of time. Or you could use the DSum function in a
calculated control to display a running sum of sales for a particular
product.

DSum(expr, domain, [criteria])

These functions are refered to as "domain Aggregate Functions". The
remaining similar functions are:

DAvg
DLookup
DFirst, DLast
DMin, DMax
DStDev, DStDevP
DVar, DVarP

--
Wayne Morgan
MS Access MVP
"Richard Holliingsworth" <wi*********************@boeing.com> wrote in
message news:Hs********@news.boeing.com...
Hi folks.

Thanks for the help, but I can't seem to find either set of commands in
the Access 2K help file. Where should I look for these commands????
Thanks,
Richard H

Wayne Morgan wrote:
I believe that CountIf and SumIf are Excel functions. Check out DCount andDSum, I believe they will do what you want.

Nov 12 '05 #5
Richard Holliingsworth <wi*********************@boeing.com> wrote in message news:<Hs********@news.boeing.com>...
Hi folks.

Thanks for the help, but I can't seem to find either set of commands in
the Access 2K help file. Where should I look for these commands????
Thanks,
Richard H


Richard,
Did you look in the Expression Builder after creating a new query?
Scroll down to functions in the leftmost window, then choose the
Built-In Functions folder under that. In the middle column, choose
"Domain Aggregate" and then DSUM and DCOUNT will show on the rightmost
window/column.
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: imani_technology_spam | last post by:
I'm trying to create an OLAP system using SQL Server 2000 Analysis Services (AS). I want the AS cube to be based on a database with a star schema. I have a field called Ratio. The initial...
2
by: Norma | last post by:
I have a table with a UPC#, CasesCompleted, TotalHours, standardGoal (pieces per hour) I am generating a report that groups by UPC and figures out production goals. In the Detail section of each...
1
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to...
2
by: hhathome | last post by:
In my report I have a calculated DateDiff Field, I also have a calculated count field. I'm trying to get a total of the DateDiff field and dividing it by the count field and I'm having problems --...
3
by: kelley.l.turner | last post by:
Hi all, I am very new to MS Access so please bear with me! I have created a simple calculated field in my data entry form, yet when I view my data table or try to generate a report based on...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
9
by: Haas C | last post by:
Hi all! Is there anyway I can override a value in a calculated field on a form? For example: I have a form which displays the following fields based on a query: Premium Due field has the...
14
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database for inventory control. I am setting up a form (frmProducts) for the viewing and adding of product information. I have several tables that this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.