Results 1 to 2 of 2
  1. #1
    kid is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2020
    Posts
    20

    Count row wise fields query

    I would like to perform a count query based on row..



    In normal query we can use (to count column)
    Code:
    SELECT COUNT(*) FROM .....
    But now I want to count the occurrences in a row...

    For Example:
    ID NAME JUNE JULY AUG SEP COUNT
    1 PETER N 3
    2 HENRY N N
    N 1
    3 DEVID N
    3
    4 KEVIN
    0

    In the above table I want to update the COUNT Column with the blank count row-wise....


    Hope I can get answer here...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Consider:

    Abs(IsNull(June) + IsNull(July) + IsNull(Aug) + IsNull(Sep))

    Shouldn't Kevin show Count of 4?

    Count is a reserved word and advise not to use reserved words as names. Better would be CountNull.
    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. Replies: 1
    Last Post: 11-03-2016, 03:14 AM
  2. Help with mulitple count fields in one query
    By SDCragg in forum Queries
    Replies: 1
    Last Post: 03-01-2015, 02:01 AM
  3. 'Count' two fields in a Query
    By dr4ke in forum Queries
    Replies: 2
    Last Post: 01-18-2013, 10:00 AM
  4. Replies: 0
    Last Post: 07-16-2012, 01:48 PM
  5. Multiple count of query fields
    By BLD21 in forum Queries
    Replies: 2
    Last Post: 05-23-2011, 01:09 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