Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-27-2017, 08:12 PM
JennEx JennEx is offline Help With Time Fields Windows XP Help With Time Fields Office 2013
Competent Performer
Help With Time Fields
 
Join Date: May 2010
Posts: 162
JennEx is on a distinguished road
Default Help With Time Fields


I have two mergefields intended to display time values from my Excel data source.
Rather than displaying the times as they are in the database, they are displaying in the merged document as simply 12:00 AM. In the mail merge preview mode though, the times are correctly represented, but other time fields on my report are in decimal. When I merge, I get the 12:00A thing happening.

Here is a textual representation of my mailmerge field in which I am having difficulty with...

{QUOTE{SET OnTime {MERGEFIELD LIGHTS_ON_TIME} } {IF{= OnTime}<> {REF OnTime \* MERGEFORMAT } "N/A""{SET ss{= OnTime*86400 \# 0}}{SET hr{IF{ss}= 0 0 {= INT(ss/3600) \# 0}}}{SET mn{IF{ss}= 0 0 {= INT((ss-hr*3600)/60) \# 0}}}{SET AMPM{IF{hr}< 12 "AM" "PM"}}{= MOD({hr}+11,12)+1 \# 0}:{mn \# 00} {REF AMPM \* MERGEFORMAT }"} }

This has been carried over from a previous version of this report, so sadly I can honestly ay I'm unsure of how it works. I'm not sure what the N/A is all about. In earlier versions, the

The data in my worksheet from which the value for Lights_on_time is a time value (eg 9:00:00 PM) formatted as 9:00 PM.

I am simply looking to repair the formula I already have, or find a suitable alternative. I have tried a simple switch { MERGEFIELD LIGHTS_ON_TIME \@"h:mm AM/PM"} but I get the same behaviour as the merge field above. Proper representation of time in the mail merge document preview, but the merge document is 12:00 AM.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With Time Fields Odd Result In Combined Merged Time Fields JennEx Mail Merge 9 04-29-2017 08:58 AM
Help With Time Fields Employee Turnover by Department/Month split between Voluntary/Involuntary - Full-time/Part-time CPSmith Excel 1 03-26-2016 02:48 AM
Help With Time Fields Displaying FORMTEXT fields when merge fields are empty or null sfkHooper Mail Merge 6 01-19-2016 04:24 PM
How do you get the DATE and TIME fields to be included in an export to Excel? tpieples Outlook 0 02-18-2013 12:11 PM
Word 2010 - DOCX File with fields -> PDF with fields senglory Word 2 03-27-2012 10:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:13 AM.


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