Tableau error Type mismatch
Can’t add string and datetime values
The + sign joins text only when every part is text. Your date field is a datetime, so Tableau cannot add it to a string. Convert the date to text first.
Which formula raises it, and what fixes it?
[Region] + ' ' + [Order Date]The xmetric engine rejects it too.
[Region] + ' ' + STR([Order Date])On each of the 3 example rows it returns:
| Region | Order Date | Result |
|---|---|---|
| East | 2025-01-05 09:30:00 | East 2025-01-05 09:30:00 |
| West | 2025-02-10 09:30:00 | West 2025-02-10 09:30:00 |
| West | 2025-03-01 09:30:00 | West 2025-03-01 09:30:00 |
Why it works. STR() turns the datetime into text, so + can join the pieces. The date format STR produces depends on the tool and locale; use DATENAME or DATEPART pieces if you need a fixed layout.
The 3 example rows
Region | Order Date |
|---|---|
| East | 2025-01-05 09:30:00 |
| West | 2025-02-10 09:30:00 |
| West | 2025-03-01 09:30:00 |
What else raises this message?
Raises it
'Ordered on ' + [Order Date]Fixed
'Ordered on ' + STR(DATE([Order Date]))Convert the date to text before joining. DATE drops the time part first.
Checked on the xmetric engine: the first fails, the fix runs.
Raises it
[Region] + DATETRUNC('month', [Order Date])Fixed
[Region] + ' ' + STR(DATETRUNC('month', [Order Date]))DATETRUNC still returns a datetime, so STR comes last.
Checked on the xmetric engine: the first fails, the fix runs.
Does my formula have this problem?
Paste your formula and run it on the example rows. It uses the fields [Region], [Order Date]; rename yours to match.
Runs in your browser on the xmetric engine. Nothing is uploaded.
Which functions does this involve?
What do people ask about this error?
How do I control how the date looks in the text?
Use DATENAME pieces, or format the field in the view instead of the formula. STR uses an ISO-like format that is the same everywhere.
Does + ever add dates?
Adding a number to a date adds days in some data sources, but DATEADD is the clear way to do it: DATEADD('day', 7, [Order Date]).
Where is this message documented?
- Where the message is reported (datacamp.com) checked October 17, 2026