DATEPART('hour',[Time DateTime]) * 3600 + DATEPART('minute',[Time DateTime])*60 + DATEPART('second',[Time DateTime])
Now there's a measure that can be used. To go from # of Seconds back to HH:MM:SS, here's a hh:mm:ss string calc with the following formula:
STR(INT(SUM( [# of Seconds] )/3600)) + ":" +
// convert minutes back to a string
IF LEN(STR(INT((SUM([# of Seconds]) % 3600 ) / 60))) = 1 THEN
"0" + STR(INT((SUM([# of Seconds]) % 3600 ) / 60))
ELSE
STR(INT((SUM([# of Seconds]) % 3600 ) / 60))
END
IF LEN(STR(INT((SUM([# of Seconds]) % 3600 ) / 60))) = 1 THEN
"0" + STR(INT((SUM([# of Seconds]) % 3600 ) / 60))
ELSE
STR(INT((SUM([# of Seconds]) % 3600 ) / 60))
END
+ ":" +
//convert seconds back to a string
IF LEN(STR(INT(SUM([# of Seconds]) % 60))) = 1 THEN
"0" + STR(INT(SUM([# of Seconds]) % 60))
ELSE
STR(INT(SUM([# of Seconds]) % 60))
END
"0" + STR(INT(SUM([# of Seconds]) % 60))
ELSE
STR(INT(SUM([# of Seconds]) % 60))
END
https://community.tableau.com/message/224840