Results 1 to 6 of 6
  1. #1
    MHD-SH is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    3

    how to show only not null values in the query

    Hello friends!

    I got a problem, I have accounting sheet with particulars, dates, and both debt and credit accounts, I need to make quires for both sides debt and credit, it's easy by using not null statements, but want the query to show only the not null values not the whole record and hide the empty cells. how to do it ?


    I don't know if I explained myself well




    thx in advance

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,730
    Without seeing your query and the table(s) involved it is difficult to offer a focused response.

    I suggest you copy the sql of the query you are currently using and post it.

    Also, it would clarify things, if you could provide readers with a sample input record, and an example of what you want for output from that record.

    Good luck.

  3. #3
    MHD-SH is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    3
    Click image for larger version. 

Name:	111.png 
Views:	13 
Size:	2.1 KB 
ID:	23994

    thx dear

    as in the pic, in every record I have 2 values, I want the query to show them only and hide the rest.

    the SQL I use is:

    Select a, b, c, d, e from table name
    where a is not null or b is not null or c is not null or d is not null or e is not null;

    but in this case access show to whole record, and that's the problem.

    I guess I need some .net statement to deal with this issue.

    thx again

  4. #4
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Please show us what the end result should look like using the example you provided

  5. #5
    MHD-SH is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    3
    I want the result to be:
    record 1: a and e only not the whole record
    record 2: a and d only
    record 3: a and c

  6. #6
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In your table, are there only five five fields and will Field a always be populated?

    Maybe this:

    SELECT tblABCDE.A, tblABCDE.B
    FROM tblABCDE
    WHERE (((tblABCDE.B) Is Not Null));
    Union
    SELECT tblABCDE.A, tblABCDE.C
    FROM tblABCDE
    WHERE (((tblABCDE.C) Is Not Null));
    Union
    SELECT tblABCDE.A, tblABCDE.D
    FROM tblABCDE
    WHERE (((tblABCDE.D) Is Not Null));
    union
    SELECT tblABCDE.A, tblABCDE.E
    FROM tblABCDE
    WHERE (((tblABCDE.E) Is Not Null));

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

Similar Threads

  1. Show null values in records
    By Nola-Edu in forum Queries
    Replies: 1
    Last Post: 04-10-2013, 12:36 PM
  2. show companies with null values
    By jamo in forum Programming
    Replies: 11
    Last Post: 11-06-2012, 08:11 AM
  3. Query and Null Values
    By ydrasil281 in forum Queries
    Replies: 1
    Last Post: 08-06-2012, 03:32 PM
  4. Replies: 2
    Last Post: 08-01-2011, 09:30 AM
  5. Query with null values
    By Psyclone in forum Queries
    Replies: 3
    Last Post: 03-30-2011, 09:57 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