Hi
All
This is samiuddin. I am having table in mysql which contain two fields like pickupdate and pickuptime.
I am using the query on this table to add time
suppose the pickupdate column is having the value as 2012-08-06 and pickuptime is having the value as 23:00:00
select addtime(‘pickupdate pickuptime’,‘2:00:00’) from xyz ;
but it is not adding the time, it is giving the result as 2:00:00
but when I am writing the function with direct values it is working properl.
select addtime(‘2012-08-06 23:00:00’ ,‘2:00:00’)
it is giving the result as 201208-07 1:00:00
‘pickuptime’ is a string
pickuptime is a column name
Get rid of the single quotes.
It won’t do you any good adding two hours to just the time though. What if you have date 2012-01-01 and time 23:00:00. What will happen if you add two hours to the time column?
Like I said before, why don’t you change your table layout and use a datetime column instead of the two separate columns your’re using now?