I have a schedule table and it has 3 fields(emp_name,date_from,date_to). This is my scenario, for example the employee greedyisgood is set for a trip from 2009-02-04 up to 2009-02-08 . (YYYY-MM-DD)
date_from = 2009-02-04
date_to = 2009-02-08
Thus when the secretary inputs a specific date 2009-02-06 via textbox for the meeting, the employee greedyisgood will not be shown on the list since the date specified is in between 2009-02-04 up to 2009-02-08. Any idea on how will be the query?
Thanks
help with sql query
Moderator: General Moderators
Re: help with sql query
You can create a query like "SELECT emp_name FROM schedule WHERE date_from < specified_date OR date_to > specified_date;"greedyisg00d wrote:I have a schedule table and it has 3 fields(emp_name,date_from,date_to). This is my scenario, for example the employee greedyisgood is set for a trip from 2009-02-04 up to 2009-02-08 . (YYYY-MM-DD)
date_from = 2009-02-04
date_to = 2009-02-08
Thus when the secretary inputs a specific date 2009-02-06 via textbox for the meeting, the employee greedyisgood will not be shown on the list since the date specified is in between 2009-02-04 up to 2009-02-08. Any idea on how will be the query?
Thanks
It will show only those employees who are not on trip as per your schedule.
Best Regards,
Mahesh Salaria