I'm trying to convert an excel scoring program and this one formula is driving me nuts. so this is the excel formula =IF(AD4<AE4,AE4-AD4,0)
and I have been stumped for a little bit. I have looked at, and tried a few sample formulas for both PHP & MySQL, but I keep receiving syntax errors, unexpected if or else in the code.
So what the formula is checking to see if the elapsed time is under a set time, and if so, calculates the difference between the 2 fields and displays the outcome in time format hh:mm:ss.
This is the latest SQL query I tried:
Select *
if (`Under Time`<`Speed Fault`,0)
else { (`Time Elapsed`-`Speed Fault`)} As Under Time
from time_db