I'm trying to extract entries from 2 fields that are between 2 times. I have extracted all entires that were entered between the start of the month and the end of the month and used mysql_num_rows() to get the total number returned. Now I want to find out which ones were entered and finished within a time frame of 3 days. I have 2 fields in the table that will be used for this purpose, both are datetime fields - date_entered and date_finished.
First off, I use this query:
SELECT date_entered, date_finished from $Table where date_entered LIKE ('2003-11%')
Now I want to find out which entries were finished 3 days or less after they were entered. I know what I want to say, I just don't know how to say it so here is the mix of mysql and English...
SELECT product_id from $Table WHERE date_finished is 3 days or less after date_entered.
I've been playing around with DATE_ADD but it hasn't had the desired effects (if any).
If anyone can give me an idea to to what the translation should look like above, I'd appreciate it.