Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying a criteria to a Query Parameter 1

Status
Not open for further replies.

rcoutts

Technical User
Sep 5, 2001
60
US
I have a Query with a Parameter field that performs a simple calculation. Something like this:
Code:
      Field:   hrs  hrs  Expr1:[Job1]![hrs]+[Job2]![hrs]
      Table:  Job1 Job2   
       Sort:
   Criteria:             >0
[\code]
If I don't put in the ">0" then the query runs fine.  But, I'd like to only show the records that have a value greater than zero for Expr1.  When I put in the ">0" criteria and run the Query, I get prompted for the values Expr1, e.g.,
[code]
   Enter Parameter Value
   [Job1]![hrs]
   |____________________|
[\code]
How do I avoid the promt?

Thanks!
Rich
 
Expr1:[Job1].[hrs]+[Job2].[hrs] Joe Miller
joe.miller@flotech.net
 
I would think you need to place the criteria in a new/seperate field.


TotHrs: Job1!Hrs + Job2!Hrs

then the criteria is

TotHrs

> 0

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I tried using a separate field but was subsequently prompted for the value of TotHrs.

I may be going about this all wrong. Really what I want is to list only the records where one or both fields have a non-zero value. E.g., if my table looks like this:
Code:
   Job1   Job2
      0      0
      2      8
      1      0
      0      0
      0      9
my query would return
Code:
   Job1   Job2
      2      8
      1      0
      0      9
What's the best way to do this?

Thanks again,
Rich
 

Try this.

Field: hrs hrs
Table: Job1 Job2
Sort:
Criteria: >0
Or: >0

I assume you have criteria that links Job1 and Job2 so the tables can be joined. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top