Creating Filters to search Contact History
Question: Is it possible to create a filter that searches the Contact History or tables other than Contact1 and Contact2?
Answer: Yes, you can create a filter and then edit the SQL Expression to add an SQL statement to search any table including History,Details or Calendar.
Below is an example of a filter that includes only accounts with a phone call or appointment completed within the last 7 days:
Create and save a Filter, any filter such as as 'Account is not Empty'
In the list of filters, highlight the filter and click 'Properties'
Under the Properties tab, select the SQL Query radio button and click 'Edit Expression'
Replace the initial SQL with a WHERE clause that picks the accounts with the data you want. For this example, it is:
Where c1.AccountNo in (select AccountNo from ContHist where sRecType in ('A','C') and OnDate > getdate() -7 and ResultCode = 'COM'
Click OK, Also, you do not need to edit anything in the dBase expression window.
Preview or Activate the filter to review the results.
This process can be used to include SQL statements in the Filters window instead of the SQL queries window, so you no longer need to build an SQL
query and then build a Group from the results. Your SQL Query is now dynamic as opposed to static.
|