Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Can someone please tell me what is wrong with this code. What I am trying to
do is: IF NationalFilingDate field is blank, THEN input the ApplicationDate ELSE input the NationalFilingDate using the format of MMMM dd, yyyy. This is the code that I have so far: { IF { MERGEFIELD NationalFilingDate }= { MERGEFIELD ApplicationDate \@ MMMM dd, yyyy } { MERGFIELD NationalFilingDate \@ MMMM dd, yyyy} } |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Are you sure that a blank record entry actually does produce a blank? Insert
the field on its own and see what it produces, then trap that. Otherwise apart from the smart quotes it looks OK. Personally I would quote the alternative options also { IF { MERGEFIELD NationalFilingDate }= "" "{ MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" }" "{ MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"}" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "manatee08" wrote in message ... Can someone please tell me what is wrong with this code. What I am trying to do is: IF NationalFilingDate field is blank, THEN input the ApplicationDate ELSE input the NationalFilingDate using the format of MMMM dd, yyyy. This is the code that I have so far: { IF { MERGEFIELD NationalFilingDate }= "" { MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" } { MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"} } |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
When the field NationalFilingDate is blank, it produces this result: 12:00:00
AM. Because of this, I am assuming that ApplicationDate won't be produced because the field is not actually blank, right? Using the code above, when the NationalFilingDate has no date in the field, the ApplicationDate has today's date rather than the ApplicationDate, which by itself produces 10/15/2008. "Graham Mayor" wrote: Are you sure that a blank record entry actually does produce a blank? Insert the field on its own and see what it produces, then trap that. Otherwise apart from the smart quotes it looks OK. Personally I would quote the alternative options also { IF { MERGEFIELD NationalFilingDate }= "" "{ MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" }" "{ MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"}" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "manatee08" wrote in message ... Can someone please tell me what is wrong with this code. What I am trying to do is: IF NationalFilingDate field is blank, THEN input the ApplicationDate ELSE input the NationalFilingDate using the format of MMMM dd, yyyy. This is the code that I have so far: { IF { MERGEFIELD NationalFilingDate }= "" { MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" } { MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"} } . |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
When the field NationalFilingDate is blank, it produces this result:
12:00:00 AM. Because of this, I am assuming that ApplicationDate won't be produced because the field is not actually blank, right? Correct. But you should be OK with { IF { MERGEFIELD NationalFilingDate }= "12:00:00 AM" "{ MERGEFIELD ApplicationDate \@"MMMM dd, yyyy" }" "{ MERGFIELD NationalFilingDate \@"MMMM dd, yyyy"}" } Or if it's "12:00:00 AM." use { IF { MERGEFIELD NationalFilingDate }= "12:00:00 AM." "{ MERGEFIELD ApplicationDate \@"MMMM dd, yyyy" }" "{ MERGFIELD NationalFilingDate \@"MMMM dd, yyyy"}" } Longer term, be aware that if for example you change the way you connect to your data source, the result of { MERGEFIELD NationalFilingDate } may no longer be the same, and you would need to change the comparand. Peter Jamieson http://tips.pjmsn.me.uk On 28/04/2010 16:43, manatee08 wrote: When the field NationalFilingDate is blank, it produces this result: 12:00:00 AM. Because of this, I am assuming that ApplicationDate won't be produced because the field is not actually blank, right? Using the code above, when the NationalFilingDate has no date in the field, the ApplicationDate has today's date rather than the ApplicationDate, which by itself produces 10/15/2008. "Graham Mayor" wrote: Are you sure that a blank record entry actually does produce a blank? Insert the field on its own and see what it produces, then trap that. Otherwise apart from the smart quotes it looks OK. Personally I would quote the alternative options also { IF { MERGEFIELD NationalFilingDate }= "" "{ MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" }" "{ MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"}" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org m wrote in message ... Can someone please tell me what is wrong with this code. What I am trying to do is: IF NationalFilingDate field is blank, THEN input the ApplicationDate ELSE input the NationalFilingDate using the format of MMMM dd, yyyy. This is the code that I have so far: { IF { MERGEFIELD NationalFilingDate }= "" { MERGEFIELD ApplicationDate \@ "MMMM dd, yyyy" } { MERGFIELD NationalFilingDate \@ "MMMM dd, yyyy"} } . |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
What result are you getting?
Did you use Ctrl+F9 to insert each pair of field delimiters { }? Have you toggle off the display of the field codes and executed the merge? -- 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, originally posted via msnews.microsoft.com "manatee08" wrote in message ... Can someone please tell me what is wrong with this code. What I am trying to do is: IF NationalFilingDate field is blank, THEN input the ApplicationDate ELSE input the NationalFilingDate using the format of MMMM dd, yyyy. This is the code that I have so far: { IF { MERGEFIELD NationalFilingDate }= { MERGEFIELD ApplicationDate \@ MMMM dd, yyyy } { MERGFIELD NationalFilingDate \@ MMMM dd, yyyy} } |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can Word 2007 apply a zip code bar code to envelopes? | Microsoft Word Help | |||
My code isn't showing in code view | Microsoft Word Help | |||
lost 25 digit code but have 20 digit cert of auth code | Microsoft Word Help | |||
How can I see a text code, such as the code for 'line return'? | Microsoft Word Help | |||
Microworks asks for a code tahat I do not know. How do I get code | Microsoft Word Help |