Results 1 to 9 of 9

Thread: Help With A Filter

Threaded View

  1. #1
    Join Date
    Dec 2009
    Posts
    79

    Help With A Filter

    SQL Server 2000 - I need to apply a filter to a query I have and am not sure how to do it. I’m thinking perhaps a CASE WHEN but I’m not sure.

    Although my query returns a number of fields, I’m primarily concerned with three in term of this filter. These three are: Customer Code, Fiscal Year End and Service Type. The service type will always be either a ‘F’ or a ‘P’ – Some customers will only have type ‘F’…some will only have type ‘P’, some will have both.

    However, if the customer code and FYE match, and the customer for that FYE has both, I only want to bring back the record with the ‘F’, not both records. I do want both records if the customer code matches, but the FYE does not.

    If someone could get me started down the path I’d be grateful. Here is a screen shot of what I’m talking about. Notice customer code 130 – same customer code, same FYE so in that case, I would only want the ‘F’ record returned.
    Attached Images Attached Images

Posting Permissions

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