View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FP
 
Posts: n/a
Default Mailmerge, querystring and (un)logical SQL (Word 2003)

Hi again,

Thank you for your prompt reply.

I tried to do this logical distribution as Doug suggested ( I retried
now, to be sure) but it ended up now and then with Command Failed (r/t
error "4198") message. I checked syntax many times and it is correct. I
think the reason may be in what Peter points to .

The data source is MS Access query. Actually, I suspected that it may
have something to do with transformation to Query Options box since
after execution of my original sentence I could see that Query Options
box was filled in with fields from my sentence as well as OR and AND
operators are were set accordingly but as there is no way to put
parentheses into the box they were ignored I guess.
I hoped there is a sort of workaround.

For sake of good order let me mentioned that there was a little mistake
in my previous post and the part which start after words "Instead I get
records
which match the following: " should be read:

SELECT * FROM x WHERE field_1 = A OR field _1 = B OR field _1 = C AND
field_2 = D AND field_3 = E AND field_3 =F ORDER BY field_4 ASC

Best regards,
FP


Peter Jamieson napisal(a):
Try what Doug suggested...then...

What is the data source? if it is a Word document or another data source
where Word is using its internal dialect of SQL, the dialect of SQL used is
much more limited than normal SQL. In that case, if the query cannot be
trqnsformed into the 5-row box in the (Advanced) Query Options dialog box,
Word may not process it properly - in other words, with those types of data
source you may not be able to issue the query you want.

Peter Jamieson