I want to get data from database based on date selected using datepicker.
I am using the following query to get data between selected dated but what i need is like when i select from_date and to_date using datepicker and click a button i want all the data assocoated with the selected date to be displayed. What change should i make in the query (I think after Between). Someone please help me. Thanks in advance. I want to use this with PHP as a server page.
SELECT
EP.Employee_Id,
TD.Training_Id,
TD.Training_Date,
DT.Topic_Name,
EP.Employee_Name
FROM
`training_details` TD
INNER JOIN `domain_topics` DT ON DT.Domain_Id=TD.Domain_Id
INNER JOIN `trainer_details` TRD ON TRD.Training_Id = TD.Training_Id
INNER JOIN `employee_profile` EP ON TRD.Trainer_Id = EP.Employee_Id
WHERE
TD.Training_Date BETWEEN '2012-12-01' AND '2012-12-31';
This might help: If you are using POST method:
OR as in your query
WHEREclause be like this:If you are using GET method, it will be: