Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006
    Posts
    67

    Unanswered: iif/condition statement

    I am working on a report, let's say I have 2 headers: businesses and products. For a unique business, the business name and product name is identical. But I don't what the same name show up twice. Anyone know the iif or conditional statement basically says: if businesses = Toys, do not show on the report.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    one poss: have a go at the query that feeds the report

    add a field
    modProd: iif([business]=[product], "", [business])

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Well 1 of the headers is subjugated to the other ... And it would looks kinda funny to have:

    Code:
    Toys, Inc.
              {Missing Product Header here}
              Barney
              Tonka
              Elmo
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Nov 2006
    Posts
    67
    Quote Originally Posted by izyrider
    one poss: have a go at the query that feeds the report

    add a field
    modProd: iif([business]=[product], "", [business])

    izy
    I did what you said, I added a field to my query, inputted iif([business]=[product], "", [business]) in the field box and ran the query. I got an error messaged: The specified filed '[Businesses]' could refer to more than one table listed in the FROM clause of your SQL statements.

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ok, you didn't mention you had joins in the query:

    so try:

    modProd: iif([whateverTheTableIsCalled].[business]=[product], "", [whateverTheTableIsCalled].[business])

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Nov 2006
    Posts
    67
    Quote Originally Posted by izyrider
    ok, you didn't mention you had joins in the query:

    so try:

    modProd: iif([whateverTheTableIsCalled].[business]=[product], "", [whateverTheTableIsCalled].[business])

    izy
    I did that...I got an error message basically saying "The Microsoft Jet database engine does no recognize '[whateverTheTableIsCalled].[business]' as a valid field name or expression."

    Sorry, maybe I should of provided more background. This query is generated from 2 queries, basically a query left joined to a crosstab query.

    [whateverTheTableIsCalled], I substituted my main table name and as well as all the query names. But the error message remains the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •