locked
Prefiltering in Reports RRS feed

  • Question

  • hello,

    I have create a report (DSMAIN) that could pre-filtering accounts (DSAccount) and contacts (DSContact)(picklist) (by using parameters)

    SELECT      FilteredAccount.name, FilteredContact.lastname  
    FROM        FilteredAccount INNER JOIN  
                FilteredContact ON FilteredAccount.name = FilteredContact.parentcustomeridname  
    WHERE       (FilteredAccount.name = @parentcustomeridname) AND (FilteredContact.lastname = @lastname) 

    works fine, but all contacts display if a account is chosen. only the related contacts to this account should display.

    ive try something with CRM_ but it doesnt work. can it be done with stored procedures? anyone got a solution for me? thanks
    Friday, February 27, 2009 10:25 AM

Answers

  • Try this query instead:

    SELECT CRMAF_FilteredAccount.name, CRMAF_FilteredContact.lastname 
    FROM FilteredAccount CRMAF_FilteredAccount 
    INNER JOIN CRMAF_FilteredContact 
    ON CRMAF_FilteredAccount.AccountID = CRMAF_FilteredContact.ParentCustomerId 
    WHERE(FilteredAccount.name = @parentcustomeridname) AND (FilteredContact.lastname = @lastname)
    

     


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Thursday, April 2, 2009 9:40 PM
    Moderator