Hi,
I have a table tableA with fields id,item,sent_to,date_posted (datetime), delivery_hrs(int(2))
date_posted is time at which record is inserted into table, delivery_hrs in hrs (int)
Here I want records whose date_posted when added to delivery_hrs results in date lesser than or equal to current date and time.
eg
If date_posted = '2010-01-13 02:30:00', delivery_hrs = 2, current datetime = '2010-01-13 05:30:00'
then delivery_time = date_posted + delivery_hrs i,e '2010-01-13 04:30:00'
which is lesser than current datetime = '2010-01-13 05:30:00'.
What will be the sql for this??
Thanks in advance!!
Regards
Mysql-Datetime addition help
Moderator: General Moderators
- rupam_jaiswal
- Forum Newbie
- Posts: 22
- Joined: Thu Jun 05, 2008 12:54 am
Re: Mysql-Datetime addition help
http://dev.mysql.com/doc/refman/5.1/en/ ... tions.html
Take a look at the DATE_ADD function:
http://dev.mysql.com/doc/refman/5.1/en/ ... n_date-add
Take a look at the DATE_ADD function:
http://dev.mysql.com/doc/refman/5.1/en/ ... n_date-add
There are 10 types of people in this world, those who understand binary and those who don't