Criteria calculation

potts

Registered User.
Local time
Today, 00:14
Joined
Jul 24, 2002
Messages
87
I've had a look on the site but can't find an answer to this question - then again, I may not be searching the correct terms!!

I have a sub form that contains periods of work and rest for various groups in a session (mainform). I want to be able to calculate the percentage of the work that was less than 12. I had used a query to find how long was spent working less than 12. However, there are some sessions where there is no work less than 12 and so a null value is returned. The query then returns no information. What I think I need either a way for the query to accept null values, or to perform the calculations on the form in unbound controls (don't know how to control the criteria or the null values here). My problem is that I'm not good enough at this to work out either method sufficiently.

If someone could show me what to do I would be extremely gateful.

Thank-you
 
Have you ever heard of the Nz() function?

Basically, it's Null -> Zero which you can use to alter Nulls for the purpose of calculations.
 
Can't say I have. How would I apply it to my current scenario?
 
NewField: Nz([MyCurrentField],0)


In a query, if you make a new field like above where MyCurrentField isthe name of your field with nulls, you'll have a new field to calculate your results from.
 
I'm sorry. I still can't get it to work. All I get when I run the query is the field headings with no information i.e. it's blank. Any suggestions?
 

Users who are viewing this thread

Back
Top Bottom