Results 1 to 2 of 2
  1. #1
    geraldselectric is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2012
    Posts
    4

    Sum Negative Numbers In Colum

    I import a CSV file that contains both positive and negative numbers into Access as Quantity. I am trying to figure a way to seperate those numbers into 2 columns. But, even more confusing, each row has a barcode and some of those barcode rows duplicate. So, I need to SUM the total of positive and negative numbers based on the barcode. I want to seperate the postive numbers (Items Out) with negative numbers (Items In) to get Items Sold. I thought the following code would be a start for getting those number, but I don't get the correct results. Can anyone help? - Thanks.

    <cfquery name="CountBarcodes" datasource='inventory'>
    SELECT barcode, sum(quantity) as QuantityPositive
    FROM temp


    WHERE Quantity > 0
    GROUP BY barcode
    </cfquery>

  2. #2
    geraldselectric is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2012
    Posts
    4
    After playing with the code more, I was on the right track, just had some bad data that was causing the values to not add up. I added another query < 0 to get negative data and it works.

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

Similar Threads

  1. need help with formatting negative numbers
    By orientalmed in forum Access
    Replies: 3
    Last Post: 03-06-2013, 01:24 PM
  2. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  3. Fixing Negative Autonumbers
    By prophecym in forum Access
    Replies: 5
    Last Post: 02-03-2011, 03:48 PM
  4. How to count negative numbers in a report
    By planner67 in forum Reports
    Replies: 3
    Last Post: 07-01-2009, 07:00 AM
  5. Row and colum color editing
    By jerald in forum Database Design
    Replies: 0
    Last Post: 03-18-2009, 05:52 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