Results 1 to 3 of 3
  1. #1
    bruegel is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Jul 2012
    Location
    London
    Posts
    40

    Inverse of Absolute Values - Function to selectively create negative values

    I import a text file into Access (365). One of the fields is a number. Because it's a txt file it's an Absolute value. The next column signifies if it's a Credit or Debit



    So:

    Field 1 Field 2

    Net Sign Ind

    2.5 C
    3.4 C
    1.6 D

    Is there a function I can use in a query to create a negative using the Sign Ind Value please?

    Field 1 Field 2 Field 3

    Net Sign Ind New Net

    2.5 C 2.5
    3.4 C 3.4
    1.6 D -1.6

    Thanks for the help (Will repost below if this comes out jumbled)

    Pieter

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    A simple IIf() would do it in a query


    Code:
    NewValue: IIf([Sign] = "D", [Net] *-1, [Net])
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    bruegel is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Jul 2012
    Location
    London
    Posts
    40
    Thank you

    I was being way too clever for my own good

    Pieter

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 42
    Last Post: 05-29-2018, 04:20 PM
  2. Replies: 4
    Last Post: 07-10-2014, 02:24 PM
  3. Replies: 2
    Last Post: 06-05-2013, 09:37 AM
  4. Show absolute values
    By Fluvio in forum Access
    Replies: 4
    Last Post: 08-16-2010, 09:24 PM
  5. Convert Negative Values to Positive
    By creativefusion in forum Queries
    Replies: 1
    Last Post: 10-21-2009, 02:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums