View Single Post
 
Old 04-28-2013, 04:48 PM
JennEx JennEx is offline Windows XP Office 2003
Competent Performer
 
Join Date: May 2010
Posts: 162
JennEx is on a distinguished road
Angry Time Fields back to 12:00A

Hello Paul ...

I just want to let you know that the printing options are working wonderfully. Thank you so much!!!

However, I've suddenly encountered problems again with the time fields on my reports. They had worked well with mergefield formatting you had suggested in post #2. But, with a field name change in the datasource, came a mailmerge field name change in the reports. The field change had no relation with any times. But after I made the changes to the mailmerge fields, ALL times went back to "12:00 AM" format. It's so weird that all the times went crazy after they were working.

In the body of the document:

Time Start =

{QUOTE{SET ss{=ROUND({MERGEFIELD start}*86400,0)}}{SET hr{=INT(ss/3600) \# 0}}{SET mn{=INT((ss-hr*3600)/60) \# 0}}{QUOTE"{=IF(hr=0,12,hr)}:{mn}" \@ "h:mm "}{IF{=hr}< 12 AM PM}}

Time End =
{QUOTE{SET ss{=ROUND({MERGEFIELD end}*86400,0)}}{SET hr{=INT(ss/3600) \# 0}}{SET mn{=INT((ss-hr*3600)/60) \# 0}}{QUOTE"{=IF(hr=0,12,hr)}:{mn}" \@ "h:mm "}{IF{=hr}< 12 AM PM}}

In the footer of my document:

a) Time 1 =

{ REF ASStart \*charformat }

where ASStart =

{Set ASStart { IF {MERGEFIELD ALtStaffStart} ="X" "2" {QUOTE {SET ss{=ROUND({MERGEFIELD ALtStaffStart}*86400,0)}}{SET hr{=INT(ss/3600) \# 0}}{SET mn{=INT((ss-hr*3600)/60) \# 0}}{QUOTE"{=IF(hr=0,12,hr)}:{mn}" \@ "h:mm "}{IF{=hr}< 12 AM PM}}}}

b) Time 2 =

{ REF ASEnd \* charformat }

where ASEnd =

{Set ASEnd { IF {MERGEFIELD ALtStaffEnd}="X" "2" {QUOTE {SET ss{=ROUND({MERGEFIELD ALtStaffEnd}*86400,0)}}{SET hr{=INT(ss/3600) \# 0}}{SET mn{=INT((ss-hr*3600)/60) \# 0}}{QUOTE"{=IF(hr=0,12,hr)}:{mn}" \@ "h:mm "}{IF{=hr}< 12 AM PM}}}}

The data in the datasource are time formatted values.
Reply With Quote