I'm trying to calculate delay
I have three columns in my database starttime, finishtime, and delay
starttime and finishtime are both DATETIME values
delay I just want TIME
anyone know how I would do this?
mySQL can I subtract TIMEDATE from TIMEDATE and get TIME
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
mySQL can I subtract TIMEDATE from TIMEDATE and get TIME
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: mySQL can I subtract TIMEDATE from TIMEDATE and get TIME
Looked into timestampdiff a little but would be nice to get the answer in a HH:MM:SS format
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: mySQL can I subtract TIMEDATE from TIMEDATE and get TIME
Figured it out!!
If you need this for yourself here is what I made work.
If you know a more efficient way to do it, please let me know
If you need this for yourself here is what I made work.
If you know a more efficient way to do it, please let me know
Code: Select all
put fld "qc" into tqc
put "SELECT errordate FROM nonc WHERE id=" & tid into tSQL
put revDataFromQuery(comma, cr, gConnectionID, tSQL) into tStartTime
put "UPDATE nonc SET qcdone=" & tqc & ", donedate=NOW(), pinkflag=0 WHERE id=" & tid into tSQL
revExecuteSQL gConnectionID, tSQL
put "SELECT donedate FROM nonc WHERE id=" & tid into tSQL
put revDataFromQuery(comma, cr, gConnectionID, tSQL) into tFinishTime
put "SELECT TIMEDIFF('" & tFinishTime & "', '" & tStartTime & "');" into tSQL
put revDataFromQuery(comma, cr, gConnectionID, tSQL) into timetotal
put timetotal into fld "delay"
put "UPDATE nonc SET delay='" & timetotal & "' WHERE id=" & tid into tSQL
revExecuteSQL gConnectionID, tSQL
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här