Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/188315-mysql-datetime-addition-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.