Hi All,
I am trying to query a db where I need to get results based on some values. The tricky part is that I need to subtract a number from a data and see if it fits the range.
The current date is sent to the sql statement but the duration value is a column in the db,as is the date_created
Can I do this? Or should I change my approach and use the date_add function to make the duration field a end date instead?
TIA
I am trying to query a db where I need to get results based on some values. The tricky part is that I need to subtract a number from a data and see if it fits the range.
The current date is sent to the sql statement but the duration value is a column in the db,as is the date_created
Code:
SELECT * FROM ads WHERE user_id =1 AND deleted =0 AND ( 2004 -04 -12 - duration ) > date_created
Can I do this? Or should I change my approach and use the date_add function to make the duration field a end date instead?
TIA