Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

Custom Mail Merge Query Option

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LDanix - 05 Aug 2004 22:49 GMT
Is it possible to create a custom query using an "IF" statement? If so, how
would it be established?
Peter Jamieson - 05 Aug 2004 23:18 GMT
Not if you mean query in the sense that Word usually uses.

If you can say a little more about what you're trying to achieve, maybe we
can give you some pointers.

Signature

Peter Jamieson

> Is it possible to create a custom query using an "IF" statement? If so, how
> would it be established?
LDanix - 06 Aug 2004 01:17 GMT
I am working with dates. I want Word to merge only records are that are
listed with "today's date". I was thinking something like {IF MERGEFIELD date
"Today's Date"} Where "Today's Date" is equal to the same type of field that
can be added to any Word document to display the current date.

I know that I could do this by changing the Query options every day, but I
am just trying to avoid that step.

> Not if you mean query in the sense that Word usually uses.
>
[quoted text clipped - 4 lines]
> how
> > would it be established?
Peter Jamieson - 06 Aug 2004 10:15 GMT
Well, you could use something like

{ IF "{ MERGEFIELD mydate \@YYYYMMDD }" = "{ DATE \@YYYYMMDD }"
"put all your text etc. here" "" }

but unfortunately, that will still produce one blank letter/page/e-mail for
all the records that do not match.

Instead, you could put

{ SKIPIF "{ MERGEFIELD mydate \@YYYYMMDD }" <> "{ DATE \@YYYYMMDD }" }

at the beginning of your merge main document - just be aware that the Word
Help in Word 2000 and later advises you not to use SKIP.

Signature

Peter Jamieson

> I am working with dates. I want Word to merge only records are that are
> listed with "today's date". I was thinking something like {IF MERGEFIELD date
[quoted text clipped - 12 lines]
> > how
> > > would it be established?
LDanix - 07 Aug 2004 01:51 GMT
"\@YYYYMMDD" Does that specify the format of the date, or do I need to
replace YYYYMMDD with an actual date?

> Well, you could use something like
>
[quoted text clipped - 31 lines]
> > > how
> > > > would it be established?
Peter Jamieson - 07 Aug 2004 08:04 GMT
It specifies a format. The syntax of these fields is described in Word Help.
You only need the format switch because the format of the date coming in
from a merge data source may not be the same as the format Word uses when it
generates a date from { DATE }. I only use YYYYMMDD through force of habit
(it's the format you need to use if you want to use > or < instead of = to
decide which date is earlier).

Signature

Peter Jamieson

> "\@YYYYMMDD" Does that specify the format of the date, or do I need to
> replace YYYYMMDD with an actual date?
[quoted text clipped - 34 lines]
> > > > how
> > > > > would it be established?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.