to make a special column

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michel Rousseau

    to make a special column

    I have a two column table containing numbers. I would like to make a
    third column called fieldname "special". In this column I would like to
    put the following:

    if column A = column B, then nothing in column C
    if column A is not equal to column B, then "XXX" in column C.

    How could this be done? Thank you.

    Michel Rousseau



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Bas Cost Budde

    #2
    Re: to make a special column

    Michel Rousseau wrote:[color=blue]
    > I have a two column table containing numbers. I would like to make a
    > third column called fieldname "special". In this column I would like to
    > put the following:
    >
    > if column A = column B, then nothing in column C
    > if column A is not equal to column B, then "XXX" in column C.[/color]

    Create a query on the table; include both the first columns, and in the
    third column write

    Same:IIf(column a=columnB,"","X XX")

    --
    Bas Cost Budde, Holland

    I prefer human mail above automated so in my address
    replace the queue with a tea

    Comment

    • Phil Stanton

      #3
      Re: to make a special column

      Not good practice to hold a calculated field in a table. What happens when
      the data in column A or B changes.

      Tables should only be used for holding raw data. Use forms or reports to
      show the information and any additional information calculated from this raw
      data in the table.

      Create a textbox called ColumnC whose ControlSource is set to:
      =IIf(ColumnA = ColumnB,"","XXX ")

      Note that the function is "iif "not "if"

      HTH

      Phil
      "Michel Rousseau" <mrousseau55@ho tmail.com> wrote in message
      news:419b722c$0 $14532$c397aba@ news.newsgroups .ws...[color=blue]
      >I have a two column table containing numbers. I would like to make a
      > third column called fieldname "special". In this column I would like to
      > put the following:
      >
      > if column A = column B, then nothing in column C
      > if column A is not equal to column B, then "XXX" in column C.
      >
      > How could this be done? Thank you.
      >
      > Michel Rousseau
      >
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***
      > Don't just participate in USENET...get rewarded for it![/color]


      Comment

      • Michel Rousseau

        #4
        Re: to make a special column


        Many thanks! Michel


        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Michel Rousseau

          #5
          Re: to make a special column

          Thanks Bas, it worked! And thanks to all for the comments.

          Michel



          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          Working...