Results 1 to 6 of 6
  1. #1
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110

    change sign (positive or negative) in select statement

    I have a table where a certain field is always negative, but in a form I always want to display it as positive. How do I do that. Let's assume the select statement is:

    SELECT Table.Field from Table



    Do I have to change the SELECT statement or is there something I can do in the text box?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Multiply by -1?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Never mind, I figured it out

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I would use the Abs() function, in case you also have positive value ever entered.

    SELECT ABS(Table1.Field) as PosNumber
    FROM Table1

    https://support.microsoft.com/en-us/...f-f4636dab9563
    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 ↓↓

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by willkr View Post
    Never mind, I figured it out
    Too late, I already answered?
    Minty's solution would be best if it could EVER be positive, but you said it could not?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Or you can just use the format property

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

Similar Threads

  1. Replies: 4
    Last Post: 09-29-2020, 10:16 AM
  2. Yes or No based on Positive/Negative
    By kenkencoco in forum Programming
    Replies: 1
    Last Post: 07-17-2013, 04:38 PM
  3. Replies: 7
    Last Post: 06-29-2013, 06:01 PM
  4. Replies: 8
    Last Post: 06-13-2013, 06:49 AM
  5. Positive to Negative
    By greek-autumn in forum Queries
    Replies: 3
    Last Post: 03-24-2013, 05:20 PM

Tags for this Thread

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