Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have used a resident load group by with in my code and I cannot calculate the correct duration in seconds between the start timestamp and end time stamp
Current_Data:
Load
datStart,
datEnd,
""Looking for a line to calculate the difference between datStart & datEnd ******
MachineName as L_Machine_Name
RESIDENT Data
Group by MachineName;
There is no aggregate here, Not sure why you required Group By? Perhaps this.
Current_Data:
Load
datStart,
datEnd,
Interval(datStart-dayEnd,'hh:mm:ss') as NewField,
MachineName as L_Machine_Name
RESIDENT Data
Can you tell us the date format your fields has.
Assuming datEnd and datStart are timestamps, the differences in seconds would be:
num(interval(datEnd-datStart, 's'))
You may perhaps not want the actual seconds, but rather keep the standard duration (1 = 1 day) and instead just display the value as seconds.
interval(datEnd-datStart, 's')
-Rob
Thanks for the comments.
I created a group by because I wanted a small table by machine... the main table 'data' has 800k rows.
I just wanted to show the last datstart and datend by machine in a small table.
Thanks for the comments.
I created a group by because I wanted a small table by machine... the main table 'data' has 800k rows.
I just wanted to show the last datstart and datend by machine in a small table.
Thanks for the comments.
The num(interval(datEnd-datStart, 's')) works and displays a number but I wanted seconds.
And the interval(datEnd-datStart, 's') doesnt work.
tried multiple things and still cannot get this into seconds.
I typed too fast.
interval(datEnd-datStart, 's')
should display the value in seconds. What does it display for you?
-Rob
May be:
=sum(datEnd-datStart) * 24 * 60 * 60