If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IF THEN ELSE CODE
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
|
|||
|
|||
IF THEN ELSE CODE
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
|
|||
|
|||
IF THEN ELSE CODE
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”} } |
#4
|
|||
|
|||
IF THEN ELSE CODE
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"} } . |
#5
|
|||
|
|||
IF THEN ELSE CODE
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"} } . |
Thread Tools | |
Display Modes | |
|
|