I have a table which holds sensor data:
id, name(varchar), value(float), time(datetime)
Now i need to select the max value of a certain day.
I'm getting a variable number like "1" which means, it should be the highest value of yesterday.
So how can i use this number to get the max value of this day?
I know so far there is this construct:
subdate(CURDATE(), ".$day.")
And also got a query for max value:
SELECT MAX(value) AS value FROM ".$tablename." WHERE sensor_id=? AND value_id=?
But i have problems to combine this with the date...
Hopefully you can help. thx