Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    38

    Unanswered: Different WHERE filter on different columns

    Hi!

    I'm doing a sales report and I was wondering if it's possible to put filters on different columns. I would like column 1 to be the customer name, column 2 sales for 2010, column 3 sales for 2009 and so on...

    This is what I have so far, selecting customer and sum and grouping by customer for a certain time period:
    SELECT Customer.CustName, SUM(SlsLine.Price) FROM PUB.SlsLine INNER JOIN PUB.SlsOrder ON SlsLine.OrderNum=SlsOrder.OrderNum INNER JOIN PUB.Customer ON SlsOrder.OrdCustNum=Customer.CustNum WHERE SlsLine.IntDlvDate BETWEEN TO_DATE ('01/01/2010') AND TO_DATE ('12/31/2010') GROUP BY Customer.CustName HAVING SUM(SlsLine.Price) > 10000

    I'm using a Progress database.

    Thanks for any replies!

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Take a look at the case expression
    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •