Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    9

    Question Unanswered: Help with Expression Builder

    I am not sure if this is possible but I have a query that has a field with negative and positive numbers. I want to create another field next to it reflecting only the negative numbers. The positive numbers should result in either a zero or blank but would prefer a zero. Is this possible in Access?

    I usually do this in Excel with an IF statement. For example: =IF(C2<0,C2,0).

    Please help!
    Last edited by cequent; 12-08-04 at 12:47.

  2. #2
    Join Date
    Sep 2004
    Location
    Charlotte, NC
    Posts
    164
    Yes, it is very similar. The new field in your query will be "=iif([OriginalFieldName]<0,[OriginalFieldName],0)", without the quotation marks.

    TD

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    do it in access the same way but add an "i" for access' "immediate-if"

    IIF([thisFieldName] < 0, [thisFieldName], 0)

    izy

    sorry TD - a simultaneous post (allowing for my slow typing speed)
    Last edited by izyrider; 12-08-04 at 12:56. Reason: oooops sort-of simultaneous posts
    currently using SS 2008R2

  4. #4
    Join Date
    Dec 2004
    Posts
    9

    Smile

    Thank You sooooo very much. I knew it had to be simple. I just couldn't get it to work.

Posting Permissions

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