I'm having troubles selecting future sessions were the date is 21 days from now. So not between now and 21 days but ONLY sessions that will take place 21 days from this day.
In my table dx_sessions_dates
I have a field timestart
of type BIGINT where a timestamp is saved (why BIGINT and not TIMESTAMP? -> Not my DB, but can't change it ... ).
My SQL Query is :
SELECT timestart, timefinish, sessionid FROM `dx_sessions_dates` WHERE timestart = UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL 21 DAY))
As you can see I want to select all the sessions where timestart is 21 days from now. 21 days from now should be 15 april 2015.
The query always returns 0 rows ... . While in my table I have a timestart with value = 1429081200
. And when you calculate the date with this you see it's 15 april 2015. Why don't I get any rows back?