Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp gjupp is offline
external usenet poster
 
Posts: 1
Default Using dates during mail merge

Can anybody help please?

Using Word 2000 (9.0.2760) we are in the process of setting up a mail merge
using a standard letter for the main document. The data source comprises in
each record, name, address and other data fields. Data will accumulate slowly
in each record, but we need to carry out mail merges at frequent intervals.

Letters generated during each mail merge must be dated with the current date,
but each date must be retained in the relevant data source records for
generating €˜directories/catalogues at a later time (using separate mail
merges) for review. It would also be beneficial for each mail merge to
produce only those letters with the current date, ie. not all record are
merged.

How can this be done, please?

Many thanks in anticipation.

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Using dates during mail merge

What are you using for the data source? Frankly, it does not sound to me
like mail merge is really the best option for this. How are you proposing
to retain each date in the data source? In a new record? In separate
fields in each record, or multiple dates in one field?

These sort of things need to be considered in the first instance.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gjupp" u41094@uwe wrote in message news:7f127da0d4ac1@uwe...
Can anybody help please?

Using Word 2000 (9.0.2760) we are in the process of setting up a mail
merge
using a standard letter for the main document. The data source comprises
in
each record, name, address and other data fields. Data will accumulate
slowly
in each record, but we need to carry out mail merges at frequent
intervals.

Letters generated during each mail merge must be dated with the current
date,
but each date must be retained in the relevant data source records for
generating 'directories/catalogues' at a later time (using separate mail
merges) for review. It would also be beneficial for each mail merge to
produce only those letters with the current date, ie. not all record are
merged.

How can this be done, please?

Many thanks in anticipation.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Thanks for the reply.

For the data source we are using a standard word doc generated by mail merge,
using standard fields for names, address, etc, and we assumed that dates
would be retained in separate fields in each record.

For the moment, until the 'system' is set up, we are entering the current
date manually in date fields for relevant records, then using skip-if (not
equal to this date) to merge only those records. This retains the date but is
crude indeed, as the skip-if date criterion has to be changed for each merge.
There must be a better way. Hope you can help to streamline the process.
Thanks.




Doug Robbins - Word MVP wrote:
What are you using for the data source? Frankly, it does not sound to me
like mail merge is really the best option for this. How are you proposing
to retain each date in the data source? In a new record? In separate
fields in each record, or multiple dates in one field?

These sort of things need to be considered in the first instance.

Can anybody help please?

[quoted text clipped - 18 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

You can compare a date in a field with the current date with your skipif
field

{SKIPIF {Mergefield DateField \@ "yyyyMMdd"} {Date \@ "yyyyMMdd"}}

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


gjupp via OfficeKB.com wrote:
Thanks for the reply.

For the data source we are using a standard word doc generated by
mail merge, using standard fields for names, address, etc, and we
assumed that dates would be retained in separate fields in each
record.

For the moment, until the 'system' is set up, we are entering the
current date manually in date fields for relevant records, then using
skip-if (not equal to this date) to merge only those records. This
retains the date but is crude indeed, as the skip-if date criterion
has to be changed for each merge. There must be a better way. Hope
you can help to streamline the process. Thanks.




Doug Robbins - Word MVP wrote:
What are you using for the data source? Frankly, it does not sound
to me like mail merge is really the best option for this. How are
you proposing to retain each date in the data source? In a new
record? In separate fields in each record, or multiple dates in one
field?

These sort of things need to be considered in the first instance.

Can anybody help please?

[quoted text clipped - 18 lines]

Many thanks in anticipation.



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Using dates during mail merge

You need to consider whether mail merge is really the right tool for this
job.

Maybe something more along the lines of the method contained in the last of
the following series of articles is more appropriate

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f44f2a2e9eb1@uwe...
Thanks for the reply.

For the data source we are using a standard word doc generated by mail
merge,
using standard fields for names, address, etc, and we assumed that dates
would be retained in separate fields in each record.

For the moment, until the 'system' is set up, we are entering the current
date manually in date fields for relevant records, then using skip-if (not
equal to this date) to merge only those records. This retains the date but
is
crude indeed, as the skip-if date criterion has to be changed for each
merge.
There must be a better way. Hope you can help to streamline the process.
Thanks.




Doug Robbins - Word MVP wrote:
What are you using for the data source? Frankly, it does not sound to me
like mail merge is really the best option for this. How are you proposing
to retain each date in the data source? In a new record? In separate
fields in each record, or multiple dates in one field?

These sort of things need to be considered in the first instance.

Can anybody help please?

[quoted text clipped - 18 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Many thanks indeed. This works fine. However, to go one step further: Is it
possible to compare the current date with a DateField that is formatted
(typed) dd+ordinals MMMMyyyyy?


Graham Mayor wrote:
You can compare a date in a field with the current date with your skipif
field

{SKIPIF {Mergefield DateField \@ "yyyyMMdd"} {Date \@ "yyyyMMdd"}}

Thanks for the reply.

[quoted text clipped - 23 lines]

Many thanks in anticipation.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1

  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Doug
This is very much the advanced course for me. It will take me some time to
get my head around this technique, but no doubt, it has considrable
advantages over mail merge. I just need to spend the time working on it.
However, many thanks for taking the time to advise. It is much appreciated.



Doug Robbins - Word MVP wrote:
You need to consider whether mail merge is really the right tool for this
job.

Maybe something more along the lines of the method contained in the last of
the following series of articles is more appropriate

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136

Thanks for the reply.

[quoted text clipped - 24 lines]

Many thanks in anticipation.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1

  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

I am pretty sure that it is not possible.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


gjupp via OfficeKB.com wrote:
Many thanks indeed. This works fine. However, to go one step further:
Is it possible to compare the current date with a DateField that is
formatted (typed) dd+ordinals MMMMyyyyy?


Graham Mayor wrote:
You can compare a date in a field with the current date with your
skipif field

{SKIPIF {Mergefield DateField \@ "yyyyMMdd"} {Date \@ "yyyyMMdd"}}

Thanks for the reply.

[quoted text clipped - 23 lines]

Many thanks in anticipation.



  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be able to
use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{ DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able to do
exact comparisons (equal or not equal), not determine whether one date is
before the other.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f567b2bcda89@uwe...
Many thanks indeed. This works fine. However, to go one step further: Is
it
possible to compare the current date with a DateField that is formatted
(typed) dd+ordinals MMMMyyyyy?


Graham Mayor wrote:
You can compare a date in a field with the current date with your skipif
field

{SKIPIF {Mergefield DateField \@ "yyyyMMdd"} {Date \@ "yyyyMMdd"}}

Thanks for the reply.

[quoted text clipped - 23 lines]

Many thanks in anticipation.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1


  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Yes, you are correct. Please see my reply to Peter Jamieson's suggestion. My
thanks to you for the further advice.


Graham Mayor wrote:
I am pretty sure that it is not possible.

Many thanks indeed. This works fine. However, to go one step further:
Is it possible to compare the current date with a DateField that is

[quoted text clipped - 10 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com



  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Yes, this is the comparison that I wish to make, preferably with a space
between month and year. And yes, we wish to make a €˜not equal comparison.

I tried your suggestion, but the merge returned nil results. Word date format
(language €˜English (UK)) was set to €˜dd MMMM yyyy without ordinal. However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it will not be
possible to achieve my aim. If so, I shall continue to use SKIPIF with the
comparison date manually inserted at each merge. This will be crude, but the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be able to
use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{ DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able to do
exact comparisons (equal or not equal), not determine whether one date is
before the other.

Many thanks indeed. This works fine. However, to go one step further: Is
it

[quoted text clipped - 11 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com

  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

You can add an ask field to collect the date at the start of the merge eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
Mergefield Date \@ "yyyyMMdd"} { REF MyDate \@ "yyyyMMdd "} }

The default date in that field is today's date, but it can be changed at the
prompt.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


gjupp via OfficeKB.com wrote:
Yes, this is the comparison that I wish to make, preferably with a
space between month and year. And yes, we wish to make a 'not equal'
comparison.

I tried your suggestion, but the merge returned nil results. Word
date format (language 'English (UK)') was set to 'dd MMMM yyyy'
without ordinal. However, this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it
will not be possible to achieve my aim. If so, I shall continue to
use SKIPIF with the comparison date manually inserted at each merge.
This will be crude, but the method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be
able to use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@" MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able to
do exact comparisons (equal or not equal), not determine whether one
date is before the other.

Many thanks indeed. This works fine. However, to go one step
further: Is it

[quoted text clipped - 11 lines]

Many thanks in anticipation.



  #13   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

OK, it certainly works here, i.e. in principle, so maybe the detail needs
checking:

preferably with a space
between month and year.


I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{ DATE \@"
MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces as usual,
and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"

--
Peter Jamieson
http://tips.pjmsn.me.uk

"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f606d68464d2@uwe...
Yes, this is the comparison that I wish to make, preferably with a space
between month and year. And yes, we wish to make a €˜not equal comparison.

I tried your suggestion, but the merge returned nil results. Word date
format
(language €˜English (UK)) was set to €˜dd MMMM yyyy without ordinal.
However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it will not
be
possible to achieve my aim. If so, I shall continue to use SKIPIF with the
comparison date manually inserted at each merge. This will be crude, but
the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be able to
use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{ DATE
\@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able to do
exact comparisons (equal or not equal), not determine whether one date is
before the other.

Many thanks indeed. This works fine. However, to go one step further: Is
it

[quoted text clipped - 11 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com


  #14   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

Hmmmm. I couldn't get it to work in Word 2003 - though I didn't have the
quotes around "{ MERGEFIELD mydatetext }"
I'll play again tomorrow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
OK, it certainly works here, i.e. in principle, so maybe the detail
needs checking:

preferably with a space
between month and year.


I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@" MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces as
usual, and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f606d68464d2@uwe...
Yes, this is the comparison that I wish to make, preferably with a
space between month and year. And yes, we wish to make a 'not equal'
comparison. I tried your suggestion, but the merge returned nil results.
Word
date format
(language 'English (UK)') was set to 'dd MMMM yyyy' without ordinal.
However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it
will not be
possible to achieve my aim. If so, I shall continue to use SKIPIF
with the comparison date manually inserted at each merge. This will
be crude, but the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be
able to use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able
to do exact comparisons (equal or not equal), not determine whether
one date is before the other.

Many thanks indeed. This works fine. However, to go one step
further: Is it
[quoted text clipped - 11 lines]

Many thanks in anticipation.


--
Message posted via http://www.officekb.com



  #15   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

Thanks Graham - I was using 2007 but will try 2003 now.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Graham Mayor" wrote in message
...
Hmmmm. I couldn't get it to work in Word 2003 - though I didn't have the
quotes around "{ MERGEFIELD mydatetext }"
I'll play again tomorrow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
OK, it certainly works here, i.e. in principle, so maybe the detail
needs checking:

preferably with a space
between month and year.


I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@" MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces as
usual, and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f606d68464d2@uwe...
Yes, this is the comparison that I wish to make, preferably with a
space between month and year. And yes, we wish to make a 'not equal'
comparison. I tried your suggestion, but the merge returned nil results.
Word
date format
(language 'English (UK)') was set to 'dd MMMM yyyy' without ordinal.
However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it
will not be
possible to achieve my aim. If so, I shall continue to use SKIPIF
with the comparison date manually inserted at each merge. This will
be crude, but the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be
able to use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able
to do exact comparisons (equal or not equal), not determine whether
one date is before the other.

Many thanks indeed. This works fine. However, to go one step
further: Is it
[quoted text clipped - 11 lines]

Many thanks in anticipation.

--
Message posted via http://www.officekb.com






  #16   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

Seems OK in both 2003 and 2000, with or without the quotes, which leads me
to wonder whether we are attempting the same thing and/or whether I have
missed a vital piece of information. SKIPIF can certainly be touchy in some
cases.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Peter Jamieson" wrote in message
...
Thanks Graham - I was using 2007 but will try 2003 now.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Graham Mayor" wrote in message
...
Hmmmm. I couldn't get it to work in Word 2003 - though I didn't have the
quotes around "{ MERGEFIELD mydatetext }"
I'll play again tomorrow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
OK, it certainly works here, i.e. in principle, so maybe the detail
needs checking:

preferably with a space
between month and year.

I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@" MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces as
usual, and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f606d68464d2@uwe...
Yes, this is the comparison that I wish to make, preferably with a
space between month and year. And yes, we wish to make a 'not equal'
comparison. I tried your suggestion, but the merge returned nil
results. Word
date format
(language 'English (UK)') was set to 'dd MMMM yyyy' without ordinal.
However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it
will not be
possible to achieve my aim. If so, I shall continue to use SKIPIF
with the comparison date manually inserted at each merge. This will
be crude, but the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that generate
precisely the date format you need to compare with, you should be
able to use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able
to do exact comparisons (equal or not equal), not determine whether
one date is before the other.

Many thanks indeed. This works fine. However, to go one step
further: Is it
[quoted text clipped - 11 lines]

Many thanks in anticipation.

--
Message posted via http://www.officekb.com





  #17   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

It appears there were two issues that prevented this from working here as
intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had a field
called MyDate (unused in the merge) which conflicted with the bookmark of
the same name. With that fieldname changed it worked.

2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields and must
revert to the switch I posted earlier. You cannot derive a date in the
format \@ "yyyyMMdd" from a field containing ordinal text.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or
whether I have missed a vital piece of information. SKIPIF can
certainly be touchy in some cases.


"Peter Jamieson" wrote in message
...
Thanks Graham - I was using 2007 but will try 2003 now.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Graham Mayor" wrote in message
...
Hmmmm. I couldn't get it to work in Word 2003 - though I didn't
have the quotes around "{ MERGEFIELD mydatetext }"
I'll play again tomorrow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
OK, it certainly works here, i.e. in principle, so maybe the detail
needs checking:

preferably with a space
between month and year.

I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{
DATE \@" MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces
as usual, and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7f606d68464d2@uwe...
Yes, this is the comparison that I wish to make, preferably with a
space between month and year. And yes, we wish to make a 'not
equal' comparison. I tried your suggestion, but the merge
returned nil results. Word
date format
(language 'English (UK)') was set to 'dd MMMM yyyy' without
ordinal. However,
this may have no relevance.

Unless your suggested SKIPIF syntax can be modified, I suppose it
will not be
possible to achieve my aim. If so, I shall continue to use SKIPIF
with the comparison date manually inserted at each merge. This
will be crude, but the
method will work.

Many thanks indeed for your advice. It is very useful.



Peter Jamieson wrote:
You mean compare with things that are in your data source like

7th February2008
1st March2008

etc?

As long as you can use date and numeric field switches that
generate precisely the date format you need to compare with, you
should be able to use a simlar technique, e.g.

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal
}{ DATE \@"
MMMMYYYY" }" }

Haven't tried it myself though, and at best you will only be able
to do exact comparisons (equal or not equal), not determine
whether one date is before the other.

Many thanks indeed. This works fine. However, to go one step
further: Is it
[quoted text clipped - 11 lines]

Many thanks in anticipation.

--
Message posted via http://www.officekb.com



  #18   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Many thanks indded for this. I will try it out over the coming weekend and
let you know the result.
I am very grateful for your time



Graham Mayor wrote:
It appears there were two issues that prevented this from working here as
intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had a field
called MyDate (unused in the merge) which conflicted with the bookmark of
the same name. With that fieldname changed it worked.

2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields and must
revert to the switch I posted earlier. You cannot derive a date in the
format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or

[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1

  #19   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

I tried this and it works just fine. Many thanks indeed for your help. It is
much appreciated. Graham Mayor also came up with a solution which I couldn't
make work. Please see my reply to his last input.

Peter Jamieson wrote:
OK, it certainly works here, i.e. in principle, so maybe the detail needs
checking:

preferably with a space
between month and year.


I suspected as much :-)

{ SKIPIF "{ MERGEFIELD mydatetext }" "{ DATE \@"D" \*Ordinal }{ DATE \@"
MMMM YYYY" }" }

works OK here with that spec. All the {} have to be ctrl-F9 braces as usual,
and the spacing and quoting is obviously import -

either one space between the two DATE fields and

\@"MMMM YYYY"

or no space between the two DATE fields and

\@" MMMM YYYY"

Yes, this is the comparison that I wish to make, preferably with a space
between month and year. And yes, we wish to make a €˜not equal comparison.

[quoted text clipped - 38 lines]

Many thanks in anticipation.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1

  #20   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Many thanks for this. I tried it out but couldn't make it work. I even tried
'tweaking' spaces and quotes (very much groping in the dark) to see it this
would do the trick. You included 'MyDate' and 'Date2' in your construction
but I cannot understand the function of 'Date2'. It is probably this element
that I have got wrong.

Peter Jamieson has suggested a solution that I have been able to make work.
This is great and really deals with my oringinal request. However, it is
irritating that I have not been able to make your 'ASK' routine to function
properly. If you have time to clarify, I shall be grateful. Please don'y
bother if you are too busy. Many thanks again.


Graham Mayor wrote:
It appears there were two issues that prevented this from working here as
intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had a field
called MyDate (unused in the merge) which conflicted with the bookmark of
the same name. With that fieldname changed it worked.

2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields and must
revert to the switch I posted earlier. You cannot derive a date in the
format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or

[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1



  #21   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

Where Graham has "date2" you need to put the name of the field in the data
source that you want to compare with (i.e. that has the date in "1st
February 2008" format)

(i.e. Graham's example has used the name "date2" where my example has used
"mydatetext", but in both cases you need to substitute the name in your data
source.)

Other than that, AFAICS, Graham's fields should work - if you change the two
{ DATE } fields in my example so that instead of looking like

{ DATE .... }

they look like

{ REF MyDate .... }

you should be there. In theory there's a typo (unusual for him :-) ) in
Graham's code:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }

should have an extra quote:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy" } \o }

but in practice it works as it is.

I'd select your field codes and press F9 to re-execute them after you change
them.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7fa15597a8bdf@uwe...
Many thanks for this. I tried it out but couldn't make it work. I even
tried
'tweaking' spaces and quotes (very much groping in the dark) to see it
this
would do the trick. You included 'MyDate' and 'Date2' in your construction
but I cannot understand the function of 'Date2'. It is probably this
element
that I have got wrong.

Peter Jamieson has suggested a solution that I have been able to make
work.
This is great and really deals with my oringinal request. However, it is
irritating that I have not been able to make your 'ASK' routine to
function
properly. If you have time to clarify, I shall be grateful. Please don'y
bother if you are too busy. Many thanks again.


Graham Mayor wrote:
It appears there were two issues that prevented this from working here as
intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ "
MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had a field
called MyDate (unused in the merge) which conflicted with the bookmark of
the same name. With that fieldname changed it worked.

2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ "
MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields and
must
revert to the switch I posted earlier. You cannot derive a date in the
format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or

[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1


  #22   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

Re the typo - I use the macro at http://www.gmayor.com/export_field.htm to
export field contructions to avoid typos. I missed it because as you noted
it works as it stands. I was however remiss in not changing the field name
from that in my data file as this added some unwelcome confusion

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
Where Graham has "date2" you need to put the name of the field in the
data source that you want to compare with (i.e. that has the date in
"1st February 2008" format)

(i.e. Graham's example has used the name "date2" where my example has
used "mydatetext", but in both cases you need to substitute the name
in your data source.)

Other than that, AFAICS, Graham's fields should work - if you change
the two { DATE } fields in my example so that instead of looking like

{ DATE .... }

they look like

{ REF MyDate .... }

you should be there. In theory there's a typo (unusual for him :-) )
in Graham's code:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }

should have an extra quote:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy" } \o }

but in practice it works as it is.

I'd select your field codes and press F9 to re-execute them after you
change them.


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7fa15597a8bdf@uwe...
Many thanks for this. I tried it out but couldn't make it work. I
even tried
'tweaking' spaces and quotes (very much groping in the dark) to see
it this
would do the trick. You included 'MyDate' and 'Date2' in your
construction but I cannot understand the function of 'Date2'. It is
probably this element
that I have got wrong.

Peter Jamieson has suggested a solution that I have been able to make
work.
This is great and really deals with my oringinal request. However,
it is irritating that I have not been able to make your 'ASK'
routine to function
properly. If you have time to clarify, I shall be grateful. Please
don'y bother if you are too busy. Many thanks again.


Graham Mayor wrote:
It appears there were two issues that prevented this from working
here as intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate
\@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had
a field called MyDate (unused in the merge) which conflicted with
the bookmark of the same name. With that fieldname changed it
worked. 2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate
\@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields
and must
revert to the switch I posted earlier. You cannot derive a date in
the format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or
[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1



  #23   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using dates during mail merge

Well, I suppose saying in "theory" is not quite right either given that
there is no formal specificaiton of the field language or its behaviour :-)

The other thing that might be causing problems here is that, regardless of
how the DATE field nested in the ASK field is formatted, the user will need
to enter the date in the format set up in their regional options (or any
other format where the month and day are not ambiguous.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Graham Mayor" wrote in message
...
Re the typo - I use the macro at http://www.gmayor.com/export_field.htm to
export field contructions to avoid typos. I missed it because as you noted
it works as it stands. I was however remiss in not changing the field name
from that in my data file as this added some unwelcome confusion

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
Where Graham has "date2" you need to put the name of the field in the
data source that you want to compare with (i.e. that has the date in
"1st February 2008" format)

(i.e. Graham's example has used the name "date2" where my example has
used "mydatetext", but in both cases you need to substitute the name
in your data source.)

Other than that, AFAICS, Graham's fields should work - if you change
the two { DATE } fields in my example so that instead of looking like

{ DATE .... }

they look like

{ REF MyDate .... }

you should be there. In theory there's a typo (unusual for him :-) )
in Graham's code:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }

should have an extra quote:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy" } \o }

but in practice it works as it is.

I'd select your field codes and press F9 to re-execute them after you
change them.


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7fa15597a8bdf@uwe...
Many thanks for this. I tried it out but couldn't make it work. I
even tried
'tweaking' spaces and quotes (very much groping in the dark) to see
it this
would do the trick. You included 'MyDate' and 'Date2' in your
construction but I cannot understand the function of 'Date2'. It is
probably this element
that I have got wrong.

Peter Jamieson has suggested a solution that I have been able to make
work.
This is great and really deals with my oringinal request. However,
it is irritating that I have not been able to make your 'ASK'
routine to function
properly. If you have time to clarify, I shall be grateful. Please
don'y bother if you are too busy. Many thanks again.


Graham Mayor wrote:
It appears there were two issues that prevented this from working
here as intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate
\@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had
a field called MyDate (unused in the merge) which conflicted with
the bookmark of the same name. With that fieldname changed it
worked. 2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF {
MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate
\@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal fields
and must
revert to the switch I posted earlier. You cannot derive a date in
the format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing and/or
[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1




  #24   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

The OP did say earlier in the thread that he was using UK pattern dates.

Just to clarify my original suggestion using the field name that was adopted
earlier in the thread, and restoring the missing quote

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy"} \o }{ SKIPIF {
MERGEFIELD DateField } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ "
MMMM
yyyy" }" }

This should work provided (as Peter indicated) {Mergefield DateField}
produces a date in the exact format
1st January 2008
ie 1[space]st[space]January[space]2008
If there is no space between 1 and st, change

{ REF MyDate \@ "d " \*Ordinal}
to
{REF MyDate \@ "d" \*Ordinal}

If you have some other format but January eg january or JANUARY you will
need more formatting switches. The match must be a true match.
http://www.gmayor.com/formatting_word_fields.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
Well, I suppose saying in "theory" is not quite right either given
that there is no formal specification of the field language or its
behaviour :-)
The other thing that might be causing problems here is that,
regardless of how the DATE field nested in the ASK field is
formatted, the user will need to enter the date in the format set up
in their regional options (or any other format where the month and
day are not ambiguous.

"Graham Mayor" wrote in message
...
Re the typo - I use the macro at
http://www.gmayor.com/export_field.htm to export field contractions
to avoid typos. I missed it because as you noted it works as it
stands. I was however remiss in not changing the field name from
that in my data file as this added some unwelcome confusion --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
Where Graham has "date2" you need to put the name of the field in
the data source that you want to compare with (i.e. that has the
date in "1st February 2008" format)

(i.e. Graham's example has used the name "date2" where my example
has used "mydatetext", but in both cases you need to substitute the
name in your data source.)

Other than that, AFAICS, Graham's fields should work - if you change
the two { DATE } fields in my example so that instead of looking
like { DATE .... }

they look like

{ REF MyDate .... }

you should be there. In theory there's a typo (unusual for him :-) )
in Graham's code:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }

should have an extra quote:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy" } \o }

but in practice it works as it is.

I'd select your field codes and press F9 to re-execute them after
you change them.


"gjupp via OfficeKB.com" u41094@uwe wrote in message
news:7fa15597a8bdf@uwe...
Many thanks for this. I tried it out but couldn't make it work. I
even tried
'tweaking' spaces and quotes (very much groping in the dark) to see
it this
would do the trick. You included 'MyDate' and 'Date2' in your
construction but I cannot understand the function of 'Date2'. It is
probably this element
that I have got wrong.

Peter Jamieson has suggested a solution that I have been able to
make work.
This is great and really deals with my oringinal request. However,
it is irritating that I have not been able to make your 'ASK'
routine to function
properly. If you have time to clarify, I shall be grateful. Please
don'y bother if you are too busy. Many thanks again.


Graham Mayor wrote:
It appears there were two issues that prevented this from working
here as intended

1. I was using an ASK field to collect the date to compare thus

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF
{ MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF
MyDate \@ " MMMM
yyyy" }" }

Unfortunately I was using one of my test data files which also had
a field called MyDate (unused in the merge) which conflicted with
the bookmark of the same name. With that fieldname changed it
worked. 2. This construction will not work for a range of dates eg

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }{ SKIPIF
{ MERGEFIELD Date2 } "{ REF MyDate \@ "d " \*Ordinal}{ REF
MyDate \@ " MMMM
yyyy" }" }

for that type of range you cannot compare dates with ordinal
fields and must
revert to the switch I posted earlier. You cannot derive a date in
the format \@ "yyyyMMdd" from a field containing ordinal text.

Seems OK in both 2003 and 2000, with or without the quotes, which
leads me to wonder whether we are attempting the same thing
and/or
[quoted text clipped - 86 lines]
--
Message posted via http://www.officekb.com

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1



  #25   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Yes, this works fine, and I think that I (just about) understand HOW it works.
So now I have 2 solutions to my orignal query. Gentlemen, many thanks indeed
for sparing the time to sort this out. We now have a 'system' that is
comfortable to use and more than adequately meets our needs. It's just great


Graham Mayor wrote:
The OP did say earlier in the thread that he was using UK pattern dates.

Just to clarify my original suggestion using the field name that was adopted
earlier in the thread, and restoring the missing quote

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy"} \o }{ SKIPIF {
MERGEFIELD DateField } "{ REF MyDate \@ "d " \*Ordinal}{ REF MyDate \@ "
MMMM
yyyy" }" }

This should work provided (as Peter indicated) {Mergefield DateField}
produces a date in the exact format
1st January 2008
ie 1[space]st[space]January[space]2008
If there is no space between 1 and st, change

{ REF MyDate \@ "d " \*Ordinal}
to
{REF MyDate \@ "d" \*Ordinal}

If you have some other format but January eg january or JANUARY you will
need more formatting switches. The match must be a true match.
http://www.gmayor.com/formatting_word_fields.htm

Well, I suppose saying in "theory" is not quite right either given
that there is no formal specification of the field language or its

[quoted text clipped - 99 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1


--
Message posted via http://www.officekb.com



  #26   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gjupp via OfficeKB.com gjupp via OfficeKB.com is offline
external usenet poster
 
Posts: 10
Default Using dates during mail merge

Many thanks again for your further input. It is much appreciated. Please also
see my final post to Graham Mayor.

Peter Jamieson wrote:
Where Graham has "date2" you need to put the name of the field in the data
source that you want to compare with (i.e. that has the date in "1st
February 2008" format)

(i.e. Graham's example has used the name "date2" where my example has used
"mydatetext", but in both cases you need to substitute the name in your data
source.)

Other than that, AFAICS, Graham's fields should work - if you change the two
{ DATE } fields in my example so that instead of looking like

{ DATE .... }

they look like

{ REF MyDate .... }

you should be there. In theory there's a typo (unusual for him :-) ) in
Graham's code:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy} \o }

should have an extra quote:

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy" } \o }

but in practice it works as it is.

I'd select your field codes and press F9 to re-execute them after you change
them.

Many thanks for this. I tried it out but couldn't make it work. I even
tried

[quoted text clipped - 44 lines]
--
Message posted via http://www.officekb.com


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1

  #27   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using dates during mail merge

You are welcome

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



gjupp via OfficeKB.com wrote:
Yes, this works fine, and I think that I (just about) understand HOW
it works. So now I have 2 solutions to my orignal query. Gentlemen,
many thanks indeed for sparing the time to sort this out. We now have
a 'system' that is comfortable to use and more than adequately meets
our needs. It's just great


Graham Mayor wrote:
The OP did say earlier in the thread that he was using UK pattern
dates.

Just to clarify my original suggestion using the field name that was
adopted earlier in the thread, and restoring the missing quote

{ ASK MyDate "Start Date" \d { Date \@ "dd/MM/yyyy"} \o }{ SKIPIF {
MERGEFIELD DateField } "{ REF MyDate \@ "d " \*Ordinal}{ REF
MyDate \@ " MMMM
yyyy" }" }

This should work provided (as Peter indicated) {Mergefield DateField}
produces a date in the exact format
1st January 2008
ie 1[space]st[space]January[space]2008
If there is no space between 1 and st, change

{ REF MyDate \@ "d " \*Ordinal}
to
{REF MyDate \@ "d" \*Ordinal}

If you have some other format but January eg january or JANUARY you
will need more formatting switches. The match must be a true match.
http://www.gmayor.com/formatting_word_fields.htm

Well, I suppose saying in "theory" is not quite right either given
that there is no formal specification of the field language or its

[quoted text clipped - 99 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200802/1



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Dates coyotem78 Mailmerge 3 August 4th 06 09:21 PM
UK dates lose format with Mail Merge DGEB Mailmerge 2 July 20th 06 10:56 PM
Mail Merge and dates Jsampson Microsoft Word Help 3 May 3rd 06 03:52 PM
How do I compare later/earlier dates in a mail merge IF field? AdamT Mailmerge 0 March 13th 06 05:06 PM
Using If Then and Else with dates in a mail merge macropod Mailmerge 1 March 28th 05 11:29 PM


All times are GMT +1. The time now is 02:16 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"