Hello.
I have solved it using flow.get (Button triggered) / flow.set (UI triggered)
var TimeStart = flow.get("TimeStartSet")||0;
var DateStart = flow.get("DateStartSet")||0;
var TimeEnd = flow.get("TimeEndSet")||0;
var DateEnd = flow.get("DateEndSet")||0;
var DateTimeStart = DateStart + " " + TimeStart;
var DateTimeEnd = DateEnd + " " + TimeEnd;
var dbQuery = "SELECT * FROM Senzorji WHERE [DateTime] >= '" + DateTimeStart + "' AND [DateTime] <= '" + DateTimeEnd + "'"
msg.payload = dbQuery;
return msg;