Microsoft Office Forums If Mergefield Not Displaying All Values

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2019, 03:30 PM
JennEx JennEx is offline If Mergefield Not Displaying All Values Windows XP If Mergefield Not Displaying All Values Office 2013
Competent Performer
If Mergefield Not Displaying All Values
 
Join Date: May 2010
Posts: 158
JennEx is on a distinguished road
Default If Mergefield Not Displaying All Values

I am needing a second set of eyes. I apologize for not beiung able to copy and paste the true mailmerge field here. I cannot get GMayors Export Field Constructioins addin to work.




{ if { MERGEFIELD R2_SRL }<> "" {MERGEFIELD r2_srl \@ "h:mm"}-{MERGEFIELD r2_sru \@ "h:mm"}P " " }


Should display, for example "1:30-2:00P" if there is a value for rs_srl. If not, the field is empty. What I am getting instead, when s2_srl = 1:30 PM (a true time), is "1:30"


Something wrong with my field? A space missing perhaps, or in the wrong spot? Too many spaces?


Both fields rs_srl and s2_sru have values in the database.
Attached Files
File Type: docx msof_DT15NG.docx (34.7 KB, 0 views)

Last edited by JennEx; 06-01-2019 at 08:55 AM.
Reply With Quote
  #2  
Old 06-02-2019, 01:51 PM
JennEx JennEx is offline If Mergefield Not Displaying All Values Windows XP If Mergefield Not Displaying All Values Office 2013
Competent Performer
If Mergefield Not Displaying All Values
 
Join Date: May 2010
Posts: 158
JennEx is on a distinguished road
Default

Can I assume that because no one has pointed out my error that there is nothing wrong with my field? Is there something else that I should be looking at? The data source appears fine.
Reply With Quote
  #3  
Old 06-02-2019, 04:17 PM
macropod's Avatar
macropod macropod is offline If Mergefield Not Displaying All Values Windows 7 64bit If Mergefield Not Displaying All Values Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Your field construction is wrong. It should be:
{ if { MERGEFIELD r2_srl }<> "" "{MERGEFIELD r2_srl \@ "h:mm"}-{MERGEFIELD r2_sru \@ "h:mm"}P"}

My own preference would be:
{IF{MERGEFIELD r2_srl}<> "" "{MERGEFIELD r2_srl \@ "hh:mm AM/PM"}-{MERGEFIELD r2_sru \@ "hh:mm AM/PM"}"}
so the AM/PM display is correctly set by the fields themselves.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #4  
Old 06-09-2019, 08:47 AM
JennEx JennEx is offline If Mergefield Not Displaying All Values Windows XP If Mergefield Not Displaying All Values Office 2013
Competent Performer
If Mergefield Not Displaying All Values
 
Join Date: May 2010
Posts: 158
JennEx is on a distinguished road
Default

Thanks Paul, I appreciate your willingness to share your knowledge with such patience. Thank you.
Reply With Quote
  #5  
Old 07-11-2019, 12:27 PM
JennEx JennEx is offline If Mergefield Not Displaying All Values Windows XP If Mergefield Not Displaying All Values Office 2013
Competent Performer
If Mergefield Not Displaying All Values
 
Join Date: May 2010
Posts: 158
JennEx is on a distinguished road
Default Still not quite right ....

I finally had an opportunity to use this mail merge document with the change Paul recommended ...



... results in ....



The data source (Excel worksheet) contains true time values for r1_srl and r1_sru.

Did I put something out of place in the field code?
Attached Images
File Type: jpg code.JPG (15.7 KB, 3 views)
File Type: jpg result.JPG (10.1 KB, 3 views)

Last edited by JennEx; 07-11-2019 at 12:29 PM. Reason: Adding image files as my inline images don't appear
Reply With Quote
  #6  
Old 07-16-2019, 02:07 AM
macropod's Avatar
macropod macropod is offline If Mergefield Not Displaying All Values Windows 7 64bit If Mergefield Not Displaying All Values Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Apart from anything else, your A/P content in the fields is not what was described. Beyond that. I'd need access to a sample data source and the mailmerge main document for diagnosis - images simply don't suffice.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Displaying Values and Linking GourdoftheFries Excel 2 01-03-2019 01:19 AM
Table with values from several locations and years - need to find comp values Ricardo Sousa Excel 9 07-27-2018 02:06 AM
If Mergefield Not Displaying All Values Table with values from several locations and years - need to find comp values Ricardo Sousa Excel 6 06-09-2018 10:51 PM
Display multiple values as new values based on selection from template. MvdB Excel 2 09-29-2015 08:51 PM
If Mergefield Not Displaying All Values Printing selected pages based on a MERGEFIELD.g. If MERGEFIELD=x then print pages 1,2,4 if MERGEFIEL Richard.p Word 3 04-21-2015 01:14 AM


All times are GMT -7. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft