Change date time to string

Hi,

I need to concatenate string and date time. But I am getting error. I assume I need to convert first the format from datetime to string. But I can’t find the way how to do it.

thanks
Maros

Hi @maros

Welcome to the eazyBI community.

In general, you could try using the format() function to convert date to string.
Try this example

CASE WHEN
Not IsEmpty([Measures].[Issue created date])
THEN
(
"created at:"||
format([Measures].[Issue created date], "yyyy-dd-mm")
||", resolved at:"||
format([Measures].[Issue resolution date], "yyyy-dd-mm")
)
END

See the attached image below!
it would concatenate created and resolved dates into a string and show results only if created date exists.

Martins / eazyBI support

1 Like

Hi @martins.vanags
Is this possible generate line break ?
For example:

Create at: yyyy-dd-mm
— Line Break —
Resolved at "yyyy-dd-mm

@Marcelo_Ignacio_Cid1

Yes, it is possible to generate brakes using chr(10)

CASE WHEN
Not IsEmpty([Measures].[Issue created date])
THEN
(
"created at:"||
format([Measures].[Issue created date], "yyyy-dd-mm")
|| chr(10) 
||"resolved at:"||
format([Measures].[Issue resolution date], "yyyy-dd-mm")
)
END

Martins / eazyBI