0

What i want may seem simple but i have been at it for hours trying to get it to work and searching the internet for answers.

What i have been trying, and failing at doing, is taking X minuets from a time selected from a database (which is in the format DateTime in the database). Then after taking X minuets, use the new time to select something else from a database, base on the new time (Which is also in the format of DateTime in the datbase).

Any help would be much appreciated.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Monster Killer
0

Following query will add 15 minutes to col2 and then compare new time with col1.
col1 and col2 must be datetime type column.

select * from mytable 
where col_1_datetime= date_add(col_2_datetime ,interval 15 minute)

Edited by urtrivedi: n/a

0

Thanks for your reply. From that i found this function which works great:

WHERE Date>DATE_SUB('$UserLastCommentDate', INTERVAL 15 MINUTE)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.