Re: Conditional Query

From: Ken Snell [MVP] (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 01/28/05


Date: Fri, 28 Jan 2005 15:03:33 -0500

Add a calculated field to your query:

DoDontUse: [YN]=[Y] And (x2/x1)<=0.85

Set the Criteria: cell for this calculated field to True.

-- 
        Ken Snell
<MS ACCESS MVP>
"Steve Freeman, SuperRealtor" <STEVE@COUNTYREALTY.COM> wrote in message 
news:aqWdndesHvz2D2fcRVn-sQ@comcast.com...
>I know, aren't they all conditional...
> I want to pull records from a table, and contained in the table are two
> numeric value fields; x1 and x2, and a Yes/No field. YN.
> What I want to do is when YN=yes (or = to a specific state I specify)
> when YN=yes, I want the query to perform the calculation where
> if x2/x1<=0.85, then retrieve the records in the query
> if x2/x1>0.85, then don't retrieve the records for the query.
> I am only interested in those records I've marked with the YN and where
> x2/x1<=0.85
>
> Here is about the best way to describe what I need.
>
> if (YN=Y,((x2/x1)<=0.85, use record, don't use record),nothing)
> I want the query to determine the YN first, then compare the values of x.
>
> Insights always appreciated more than you know!
> -Steve
>
> 


Relevant Pages

  • Re: Else If Statements
    ... are saying I would have first take the select query with the calculated field ... in it and make it into a make table query and then do another select query. ... Within the origional table there is a post code field. ... postcode down to only show the first part of the postcode i.e. the alpha ...
    (microsoft.public.access.queries)
  • RE: Passing variables to Function
    ... Ok here is the calculated field from my query and my primary function. ... add previous cycle totals if they exist. ... be called from the qryReagent1 query. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Else If Statements
    ... I started with a table with about 8 columns in it and then pulled a query ... Within the origional table there is a post code field. ... postcode down to only show the first part of the postcode i.e. the alpha ... What I need to do then is to put another calculated field into the ...
    (microsoft.public.access.queries)
  • Re: User defined function in SQL statement
    ... I'm taking your advice and trying to incorporate the second table in the SQL ... CONVERSION TABLE] AS B ... calculated field for both Existing and Proposed so I had to move the Nz and ... Query works. ...
    (microsoft.public.access.queries)
  • Re: uer
    ... > I'm creating a query in design view. ... > function to create a calculated field. ... > So I type a name for the calculated field "NewFieldName", ...
    (microsoft.public.access.queries)