Format date fields

Video Contents

0:00 Reformat dates with a merge field switch

0:25 Reformat instead of pre-cleaning your data

0:40 Date format rules and samples

0:51 Basics Project step: change the Timestamp format

1:59 Preview Results to see the date formats applied to the connected Data Source file

2:27 Practice

3:07 Completed: Formatting Dates

Video Transcript

Dates can come to us in all shapes and sizes. In the Data Source file for this course, the dates follow a standard month, day, year, and time format. But you might also get some variations in your own data with formats like Jan 4, 2022, Tuesday. Things that don't look so clean. You can actually accommodate a lot of these and reformat your dates for your Mail Merge Template using a switch with your merge field. A switch might not solve all of your date formatting problems, but, when it does, it will mean that you don't have to spend time cleaning your Data Source file, or trying to get your survey or form application to generate dates in a different format.

In the Quick Reference Guide for this course, I've included some rules and samples for you as a starting point. If you're used to working with Excel, this might look very familiar to you.

For this Basics Project, you're going to add a switch for the Timestamp merge field in accordance with your notes, which tell you that you want a three letter month name followed by the day and four digit year, and you want to get rid of all of the time information. From the Quick Reference Guide, you can see that the format for that is MMM space d comma space yyyy. Note that all of those Ms are capital Ms. The ds and ys are lowercase. To add that into the Timestamp merge field, toggle into field code view. Then put your cursor inside the curly braces right after the word Timestamp. Enter a space, and then type in the switch backslash, at symbol, space, double quotation mark, M, M, M, space, d, comma, space, y, y, y, y, double quotation mark. And make sure there's still a space between that last double quotation mark and the right curly brace. Do you want to see what that looks like? I do! Toggle back to the normal view, and, in the Mailings tab of the Ribbon, select the button for Preview Results. You can use the arrow keys to flip through a few records and make sure that everything is coming through the way you want it to. Exit out of preview mode by unselecting the Preview Results button on the Ribbon, and then toggle back to the field code view so we can keep making changes.

Before moving on to the next lesson, go ahead and play with a few different date formats. Keep in mind these rules: All date switches have to start with backslash at symbol, and the date format you want to use has to be inside double quotation marks. And make sure that you have a space before the backslash of the switch and a space on either side of the quotation marks of your date format. Enter and exit preview mode just like we did in this video to see the results of your experimentation. Remember that you can't really break anything. If all else fails, just delete the entire Timestamp placeholder, insert a new one, and start again.

I'll see you in the next video!

Complete and Continue