Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
pschatz100
 
Posts: n/a
Default Count the occurances of a data value


I have a database that stores membership information for my club. I can
export member information as a .csv file, and would like to create a
report that uses mailmerge to print selected member information,
including a count of the member types (active, expired, etc.) For
instance, using the .csv file as a data source I would print a list of
new members, plus a count of the total number of active members.

I can already read through the list of members, and using an IF
conditional, just print the ones that are new members. Pretty cool.


--
pschatz100Posted from - http://www.officehelp.in

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Count the occurances of a data value

Counting them is relatively easy - something like

{ IF { MERGESEQ } = 1 "{ SET mycount 1 }" "{ SET mycount { ={ REF
mycount }+1 } }" }

should do it.

The real difficulty is that there is no easy way to tell that you are
merging the /last/ record so that you can then output the count.

In this case, one way to work around that would be to
a. output to a new document
b. output the count for every record in a format that is easily found using
Find/Replace. For example, you could output

##{ REF mycount }##

c. after the merge, delete the ## characters surrounding the final count,
then use Edit Replace to replace "##(*)##" by "\1" (leave out the "
characters, click the "More" button in the dialog box, and check the Use
wildcards option.

Peter Jamieson
"pschatz100" wrote in message
news

I have a database that stores membership information for my club. I can
export member information as a .csv file, and would like to create a
report that uses mailmerge to print selected member information,
including a count of the member types (active, expired, etc.) For
instance, using the .csv file as a data source I would print a list of
new members, plus a count of the total number of active members.

I can already read through the list of members, and using an IF
conditional, just print the ones that are new members. Pretty cool.


--
pschatz100Posted from - http://www.officehelp.in




  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
pschatz100
 
Posts: n/a
Default Count the occurances of a data value


Peter,

Thanks. the counting works great. People like you make this stuff
look easy!!


--
pschatz100Posted from - http://www.officehelp.in

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
How do I create a read-only mail merge data source? Julie Mailmerge 3 November 16th 05 07:23 PM
How do I consolidate multiple mail merge data files into one file Robert Mailmerge 6 July 7th 05 10:11 PM
DotNet Data Table as Mail Merge Data Source goraya Mailmerge 1 July 7th 05 09:51 AM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM
Word Field Codes in Excel data file mranz Mailmerge 7 December 11th 04 09:02 AM


All times are GMT +1. The time now is 04:23 PM.

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"