I am trying to get data from a SQL View to a Word MailMerge Document. I am constantly getting all the data in the SQL View, but I only want a partial list. I would like for the following SQL Select Statement to be run to merge the data:
"SELECT * FROM MailMerge Where Username = 'administrator'"
Instead it always seems to run: "SELECT * FROM MailMerge" so I get all the records.
I have edited the following section of the ODC file to contain my SQL Select Statement and it works when I double click the ODC and opens in Excel. I can not get it to filter the data within a Word Document though.
<odc:CommandType>Text</odc:CommandType>
<odc:CommandText>select * from MailMerge where username='administrator'</odc:CommandText>
Is there anything else I can do? I've tried re-creating my Word Docs pointing to the new ODC and nothing seems to work.