"OR" IN QUERY

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bill Gargan (BGargan_at_EasternSlopeInn.com)
Date: 05/10/04


Date: Mon, 10 May 2004 12:44:04 -0700

I have a query that works -- and need to change one field
in it.

The one that works is:
PRICE: IIf([INVOICE DETAIL]![ITEM TYPE]="MATERIALS",ROUND
([QUANTITY]*[RATE]*1.265,2),ROUND([QUANTITY]*[RATE],2))

It fails when I change it to read:
PRICE: IIf(or([INVOICE DETAIL]![ITEM TYPE]="MATERIALS",
[INVOICE DETAIL]![ITEM TYPE]="SUBCONTRACT"),ROUND
([QUANTITY]*[RATE]*1.265,2),ROUND([QUANTITY]*[RATE],2))

The error message I get when I try to save the query is:
"The expression you entered contains invalid syntax. You
may have entered a comma without a preceding value or
identifier."

Any ideas why this fails.

Thanks,
Bill Gargan



Relevant Pages

  • Re: PHP + MySQL + Queries that depend on each other?
    ... if echo mysql_error; ... If it fails, it will display the succeeded error. ... Should this procedure be done every time a query is done, or, ... or take down the server between queries. ...
    (comp.lang.php)
  • Re: query from form
    ... The following forces the type of test to be a string. ... I have a question about applying to this to a query within a report. ... The query that fails refers to the text box on the form. ...
    (microsoft.public.access.queries)
  • Re: Decimal fieldss precision is too small to accept the numeric you attempted to add
    ... Your test query, as is, works fine. ... Can't understand why the same expression does not work in MY query. ... Tried putting the Cdbl) around both of those, still fails. ... If they are queries, you may need to perform the typecasting in the lower queries. ...
    (microsoft.public.access.queries)
  • Re: Date not within range query
    ... When Name Autocorrect works it is nice. ... can cause problems and often fails to work. ... Now use that and your entities table to do an unmatched query. ... have no linked records that fall inside a date range. ...
    (microsoft.public.access.queries)
  • Re: Small automated theorem proving problem
    ... on the board such that no piece attacks any other piece: ... This quickly fails with the theorem prover claiming to exhaust its ... denial of your "question" IS CONSISTENT with your axioms. ... Then, the second query works. ...
    (sci.logic)