One of my co-workers asked how can we format a date field in a MS Word Layout document so that it only shows the date but not the time.
To get started with adding fields to a Word Report Layout start with this:
How to Add Fields to a Word Report Layout – Business Central | Microsoft Docs
Let’s say you added a date field: CustomDate to a BC report.
When you run the report the date field renders on the report as DateTime: 30-06-2021 12:00:00.
How do we enforce the report to only display the date: 30-06-2021
Let’s look at a simple example: you want to add to the report 206, Sales Invoice, in a custom Word Layout the DueDate_SalesInvHeader field from the dataset.
If you followed the link above you might have now a control on your document that looks like this:

If this field is coming from AL with Date and Time components, how do we format it so it only shows the Date?
In RDLC you would go to the properties of the text box that is hosting your datetime field and change the Format property to “d”.
How about Word Layouts?
It’s quite simple, but not easily available in the documentation.
You would change the date field in the layout to show like this:

You can change the formatting to match your region. In US: dd/MM/yyyy.
There is always the option of writing an extension and send to layout an already formatted date field as text.
3 Responses
Hello
I can’t see how to do this in work, I don’t see this, I don;t see the field as { { field name } }. How do I make the changes?
Nick
CTRL + F9, see this: https://www.thedoctools.com/word-macros-tips/word-tips/word-fields-useful-keyboard-shortcuts/#:~:text=Short%20overview%20of%20field%20shortcuts%20-%20with%20names,%20%20InsertFieldChars%20%203%20more%20rows%20
Hello
The date switch to use should be { DATE DueDate_SalesInvHdr \@ “dd/MM/yyyy” }
Highlight the field then hit ctrl + F9 to add curly brackets around it. Then edit text between brackets to look like the above.