Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    Dear Ridders52,

    Thanks for your mail and sorry for not replying sooner.

    I checked your example, thanks for the help. In your example I would like to point you to record #6 where everything is NULL, but in total with Nz we can get the 0 there. My requirement is to get zero at Record #6 (Payment1, Income1, Income2) cells. As these fields are NULL similarly I am also getting the data from a query where the fields or Record is NULL.

    Thanks and Regards


    Deepak Gupta

  2. #17
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    I had deliberately left it like that so you could see how it worked
    That's very easy.
    Just set the default value of each field to zero as I stated in post #2
    Doing that also means all the Nz functions are no longer needed
    See attached
    Attached Files Attached Files
    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. #18
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    Dear Ridders52,

    I agree you mentioned it earlier and even suggested a way out, but it will work only when you have 0 as the answer in the field not when you have no records and the value is NULL. I am getting my report from a Query (Union Query, which is made of 4-5 queries and some queries don't have the records to the criteria mentioned in them.

    Hope I have been able to explain my point, if still not clear I can send you an example DB for your reference.

    Thanks and Regards
    Deepak Gupta

  4. #19
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Then use Nz(fieldname,0) instead of field name for each number/currency field in your union query.

    Or, do as I did, set the default value to zero in the source tables.
    You would need to run update queries on existing data to update nulls to zero.

    Both approaches will work as I have already shown you.
    Decide which you prefer and implement it.

    If you have no records at all, add a dummy record with zero values to your union query
    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

  5. #20
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    Hi Ridders52,

    Thanks for all the support and guidance. I have been able to get the desired results. Used Nz function again in the query as suggested earlier, but don't know why it did not work last time, probably i was making some syntax error or doing something wrong.

    Now everything is working and thanks for the help.

    Regards
    Deepak Gupta

  6. #21
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Excellent. Glad you got there in the end.
    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

  7. #22
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    I feel the problem was with Group function. When applying NZ function with group was causing no result, what I did was converted the query to sql (with group function) and then later applied the Nz function in Sql Mode to the query and it worked.

    Thought would share might help some one.

    Thanks and Regards
    Deepak Gupta

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 03-25-2018, 01:13 PM
  2. Replies: 4
    Last Post: 03-11-2017, 09:48 PM
  3. Replies: 5
    Last Post: 03-08-2016, 07:25 AM
  4. Query Help - Show field if another field is null
    By lukekonrad in forum Access
    Replies: 1
    Last Post: 03-05-2012, 04:02 PM
  5. Do not show null records
    By brobb56 in forum Forms
    Replies: 1
    Last Post: 09-23-2011, 02:29 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