Results 1 to 3 of 3
  1. #1
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    168

    Blank or null = 0

    I apologize this is probably a common question and the answer is probably NO.

    But I am having problems doing math in a qry

    PastDue: [DuesOwed]-[DuesPaid]

    PastDueFines: [FinesAssessed]-[FinesPaid]

    TotalOwed: [DuesOwed]-[DuesPaid]+[FinesAssessed]-[FinesPaid]

    if I have a value in [DuesOwed] and nothing, Null, Blank in [DuesPaid] it wont do the math

    I have to have a 0 in every field where there is a blank to get the calculations to work.

    is there a way to write the expresion to accept null as 0

    and if not is there a quick and easy way to go back through 400 rows of data and enter all the 0s



    thanks for the help

    Click image for larger version. 

Name:	Capture.1PNG.jpg 
Views:	16 
Size:	123.2 KB 
ID:	46995

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    The answer is YES
    Use Nz(expression,0)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If you want any Null to be treated as 0 so fields with number will still add up, enclose each field in Nz() function

    Nz([DuesOwed])-Nz([DuesPaid])+Nz([FinesAssessed])-Nz([FinesPaid])

    Otherwise, use Find/Replace to populate all Null fields with 0.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. transform zero values into null (blank)
    By mar7632 in forum Access
    Replies: 15
    Last Post: 03-11-2019, 02:41 AM
  2. If Blank or Null Grab Previous Value
    By Kaloyanides in forum Queries
    Replies: 3
    Last Post: 01-16-2019, 05:37 PM
  3. Remove Blank Space if Null
    By laniebe in forum Reports
    Replies: 3
    Last Post: 04-27-2017, 01:01 AM
  4. Blank form on null query results
    By JackieEVSC in forum Forms
    Replies: 11
    Last Post: 11-30-2011, 08:39 AM
  5. Null field blank
    By brobb56 in forum Reports
    Replies: 3
    Last Post: 09-26-2011, 12:15 PM

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