Editing SQL

You can use the Edit SQL dialog box to create and edit SQL statements for mail merge fields. You can use the Edit menu or toolbar to cut, copy, paste, or delete text. You can also insert parameters into an SQL statement.

Note: Editing SQL is recommended for Advanced Users only.

To edit an SQL statement:

  1. Specify or edit the SELECT statement you want to add to the merge field.
  2. Click in the Edit SQL view where you want to insert the parameter.
  3. Click Insert Parameter, or from the Edit menu select Insert Parameter.

    A list of parameters that can be added is displayed:

    • AccountID: Inserts an :AccountID SQL parameter. This parameter is replaced with the AccountID for the contact record being merged to.
    • AccountManager ID: Inserts an :AccountManagerID SQL parameter. This parameter is replaced with the AccountManagerID for the contact record being merged to.
    • AddressID: Inserts an :AddressID SQL parameter. This parameter is replaced with the AddressID for the contact record being merged to.
    • ContactID: Inserts a :ContactID SQL parameter. This parameter is replaced with the ContactID for the contact record being merged to.
    • OpportunityID: Inserts an :OpportunityID SQL parameter. This parameter is replaced with the OpportunityID for the contact record being merged to.
    • UserID: Inserts an :UserID SQL parameter. This parameter is replaced with the User ID for the mail merge user.
  4. Select the parameter you want to insert.
  5. Click OK.
Related topics