Question

I have SELECT statement from 3 tables. Need help in one WHERE condition. E.g. in first table date field sets date as 2014-02-26, in the second - random integer 7, 14 or 30. So i have something like this SELECT ... JOIN ... WHERE (first_table.date + second_table.integer - NOW) = 1. SELECT and JOIN part I know. I need some help with date computing.

No correct solution

OTHER TIPS

Try this one:

SELECT ... 
FROM ... 
JOIN ... 
WHERE (DATEDIFF(DAY FROM first_table.date TO NOW) + second_table.integer) = 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top