Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    13

    Unanswered: Changing a Positive Number to Negative

    I have a table that has a column with a numerical values in, and another column that denotes whether the numerical value is positive or negative.

    The column with the number in is always positive.

    The other column has 2 values:
    P = Positive (for payment)
    R = Negative (refund)

    How can I get a query to show the numerical number as a negative if the other column has an "R" in it?...and also have it shown as a numerical value?

    Many thanks in advanced

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by IronEagleUK
    I have a table that has a column with a numerical values in, and another column that denotes whether the numerical value is positive or negative.

    The column with the number in is always positive.

    The other column has 2 values:
    P = Positive (for payment)
    R = Negative (refund)

    How can I get a query to show the numerical number as a negative if the other column has an "R" in it?...and also have it shown as a numerical value?

    Many thanks in advanced
    Hi

    Perhaps:
    Code:
    Iif(PosNegCol = 'R', NumberCol *-1, NumberCol)
    or
    Code:
    CDbl(SWITCH(PosNegCol = 'R',"-") & NumberCol)
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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