
February 14th, 2004, 08:07 PM
|
|
|
|
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152
Time spent in forums: < 1 sec
Reputation Power: 4
|
|
|
RE: mysql select between help
I am not sure if this is what you are looking for, but you can use the between keyword...
SELECT distinct cust_serv_agent_id FROM `cust_serv`
where DATE_FORMAT(cust_serv_agent_time_compl, '%Y-%c-%e') between '$startDate' and '$endDate'
This would also include the start and end dates in the selection process. Another way to do it would be...
SELECT distinct cust_serv_agent_id FROM `cust_serv`
where DATE_FORMAT(cust_serv_agent_time_compl, '%Y-%c-%e') > '$startDate' and DATE_FORMAT(cust_serv_agent_time_compl, '%Y-%c-%e')<'$endDate'
this would only return dates that are between those two dates.
|