Results 1 to 3 of 3
  1. #1
    quest is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    1

    query- hide positive and negative equal values

    Hi:
    I have a column with numbers with equal absolute values that are either positive or negative. I would like to query both them but I am only getting back one of them. I would like both to be returned when queried.


    EXAMPLE:

    UNIT Date


    5 1/2/09
    -5 1/2/09
    10 2/2/09
    15 3/2/09
    -7 1/2/09
    -20 4/2/09


    Basicly, the results I would like to be is:

    UNIT DATE
    10 2/2/09
    15 3/2/09
    -7 1/2/09
    -20 4/2/09


    --The positive and negative equal values are taken out/hidden--
    I have been using in Criteria:


    NOT In (SELECT abs([UNIT])FROM [SHEET] As Tmp GROUP BY abs([UNIT]),[Date] HAVING Count(*)>1 And [Date] = [SHEET].[Date] )


    The negative number is still being shown. And the positive number is hidden.
    UNIT Date
    5 1/2/09
    10 2/2/09
    15 3/2/09
    -7 1/2/09
    -20 4/2/09

    Both of these should be hidden (numbers that cancel out):
    UNIT Date
    5 1/2/09
    -5 1/2/09

    Thanks in advance for your help.

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Try Grouping by Date. Then Sum the Unit values.

    The Sum of the Values should not be equal to ZERO.

    PS. Date is a Reserved Word and I also think Unit is also a Reserved Word.

    Try myDate and myUnit

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    MVP Allen Browne maintains a pretty exhaustive list of Reserved Words.

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

Similar Threads

  1. Convert Negative Values to Positive
    By creativefusion in forum Queries
    Replies: 1
    Last Post: 10-21-2009, 02:47 AM
  2. Replies: 2
    Last Post: 09-10-2009, 05:42 AM
  3. Set Numbers equal to each other
    By ygu3 in forum Access
    Replies: 1
    Last Post: 07-16-2009, 07:34 PM
  4. Sum Of Positive Number and Negative Number
    By maysamab in forum Reports
    Replies: 1
    Last Post: 10-20-2008, 04:06 PM
  5. Matching positive with negative amounts
    By cwert11 in forum Access
    Replies: 1
    Last Post: 09-29-2008, 12:26 AM

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