Hi there, I wish to split the [Moment] colum...

(Roberta Zola) #1

Hi there,

I wish to split the [Moment] column, which is DateTime format --> in 2 columns Day and Hour, with a Number format. I have no problem with the DAY function, result is ok.

1 - But I am struggling with the HOUR([Moment]) formula that returns the error “Parameter 1 of function HOUR is of the wrong type”.

I’ve understood I need to have a Duration type for this function, so I was thinking of calculating duration from 0 to TIME([Moment]) but I cannot define this virtual column as duration.

2 - nor it works if I use the LEFT(TIME([Moment]),2) workaround. Error says “Parameter 1 of function LEFT is of the wrong type”

Do you know what transformation I need to do or if there is an easy formula to split

[Moment] column into its components? I feel so nerd _ Thanks, have a good day.

(Aleksi Alkio) #2

The format should be like HOUR(TIME([Moment])-“00:00:00”)

(Roberta Zola) #3

@Aleksi_Alkio gosh, so easy! thanks, it works.

(Aleksi Alkio) #4

You’re welcome