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
- First off, make sure the format of the time in Excel file is right.
- Then open Word and click “Mailings” tab first.
- Next click “Select Recipients” icon in “Start Mail Merge” group.
- On the drop-down list, choose “Use Existing List”.
- In “Select Data Source” window, find and open the correct Excel file.
- Next in “Select Table” dialog box, select the right sheet containing the table.
- Click “OK”.
- Now place your cursor at positions where the data field goes.
- Click “Insert Merge Field” icon under “Mailings” tab.
- Then choose “Date”.
- Repeat from step 8 to 10 to insert date fields for “Year”, “Month” and “Day”.
- Next right click on the field and choose “Toggle Field Codes” or just press “Alt+ F9”.
- Now add “\@”yyyy””, “\@”M”” and “\@”d”” codes respectively to the 3 fields, such as below:
- After this, press “Alt+ F9” and click “Preview Results” icon. You can see the date now has been split.
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.
- First and foremost, follow from step 1 to 9 in method 1.
- Only this time, you should choose “Time” on the drop-down list of “Insert Merge Field”.
- 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.
- Then enter “\@”h””, “\@”m”” and “\@”s”” respectively to the 3 field codes.
- Next press “Alt+ F9” again to switch back from the code mode.
- Lastly, click “Preview Results” again and you shall see the effects.
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.
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