I have a parking system and I try to make a php script to calculate price than print to POS printer.
I get the insterted time from mssql like : 2013-01-04 12:49:49
I would like to calculate the elapset time to timenow();
than set value like this in minutes:
if 30 = 0;
if 60 = 1;
if 120 = 2,50
…… and and 🙂
is it possible?
Try this please using
DATEDIFF:Another approach would be (if you require you may round it up):
Or using
hh:EDITING OP’S query in the comment to use JOINs