2 Ways to Extract Separate Components from Date or Time in Word Mail Merge

In this article, we intend to show you 2 ways to extract separate components from date or time in Word mail merge.

In Word, we use “Mail Merge” feature quite often. And there can be times when we have to split a date or time and insert its components, say, year and month and day, to different places on Word document.

And on another situation, if you are a database administrator, you may have to handle server uptime and downtime report. Then you are likely to extract the exact time uptime and downtime and split them separately by hour, minute, and second.

Method 1: Split a Date

  1. First off, make sure the format of the time in Excel file is right.Dates in Excel File
  2. Then open Word and click “Mailings” tab first.
  3. Next click “Select Recipients” icon in “Start Mail Merge” group.
  4. On the drop-down list, choose “Use Existing List”.Click "Mailings" ->Click "Select Recipients" ->Click "Use Existing List"
  5. In “Select Data Source” window, find and open the correct Excel file.
  6. Next in “Select Table” dialog box, select the right sheet containing the table.
  7. Click “OK”.Click Sheet Name ->Click "OK"
  8. Now place your cursor at positions where the data field goes.
  9. Click “Insert Merge Field” icon under “Mailings” tab.
  10. Then choose “Date”.Click "Insert Merge Field" ->Choose "Date"
  11. Repeat from step 8 to 10 to insert date fields for “Year”, “Month” and “Day”.
  12. Next right click on the field and choose “Toggle Field Codes” or just press “Alt+ F9”.Choose "Toggle Field Codes"
  13. Now add “\@”yyyy””, “\@”M”” and “\@”d”” codes respectively to the 3 fields, such as below:Add Codes
  14. After this, press “Alt+ F9” and click “Preview Results” icon. You can see the date now has been split.Click "Preview Results"

Method 2: Split Time

In method 1, we have introduced the steps to split a date. In the following instructions, we shall show you how to split time.

  1. First and foremost, follow from step 1 to 9 in method 1.Time in Excel File
  2. Only this time, you should choose “Time” on the drop-down list of “Insert Merge Field”.Click "Insert Merge Field" ->Click "Time"
  3. Now you have inserted fields on the correct places. Right click on the field and choose “Toggle Field Codes” or simply press “Alt+ F9” to switch to the code mode.
  4. Then enter “\@”h””, \@”m”” and “\@”s”” respectively to the 3 field codes.Enter Codes
  5. Next press “Alt+ F9” again to switch back from the code mode.
  6. Lastly, click “Preview Results” again and you shall see the effects.Again Click "Preview Results"

Using this way to extract time by hour, minute and second, can clearly indicate the details of different servers.

Stay Alert to File Corruption

It’s been a universally knowledge that user error can cause Word to shut down and result in file loss. Thus extra attention has been payed to avoid any bad operation habit when deal with Word documents. However, no matter how hard you have tried, you can still fall victim to Word crashes. Then you will badly need an efficient Word document damage recovery tool as an attempt to recover damaged files.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel xlsx data error repair and pdf repair software products. For more information visit www.datanumen.com

Comments are closed.