Hi,
My problem is: I want to display employees tasks which recorded during two given dates
I do this: select all dates based on employee ID, and place bind those dates to TWO dropdownlist "StartDate, EndDate".
When the employee select a start date and end date I want to display him the tasks which are between those dates,
Actually it works But, it will never work if the employee have just two records cause the condition here is Between and there will be nothing between two.
The second thing when i tried to add (OR EndDate = @EndDate) the SQL querey manager gave an error msg.
Here is my SQL code hope u help
SELECT TaskTable.TaskD ate, TaskTable.TaskD escription, TaskTable.TimeS tart,
TaskTable.TimeE nd, CustomerTable.C ustomerName, CustomerTable.P hone, CustomerTable.A ddress
FROM TaskTable INNER JOIN CustomerTable ON TaskTable.Custo merID = CustomerTable.D ocumentID
WHERE (TaskTable.Empl oyeeID = @EmployeeID)
AND (TaskTable.Task Date BETWEEN @EndDate AND @StartDate) ORDER BY TaskTable.TaskD ate DESC
My problem is: I want to display employees tasks which recorded during two given dates
I do this: select all dates based on employee ID, and place bind those dates to TWO dropdownlist "StartDate, EndDate".
When the employee select a start date and end date I want to display him the tasks which are between those dates,
Actually it works But, it will never work if the employee have just two records cause the condition here is Between and there will be nothing between two.
The second thing when i tried to add (OR EndDate = @EndDate) the SQL querey manager gave an error msg.
Here is my SQL code hope u help
SELECT TaskTable.TaskD ate, TaskTable.TaskD escription, TaskTable.TimeS tart,
TaskTable.TimeE nd, CustomerTable.C ustomerName, CustomerTable.P hone, CustomerTable.A ddress
FROM TaskTable INNER JOIN CustomerTable ON TaskTable.Custo merID = CustomerTable.D ocumentID
WHERE (TaskTable.Empl oyeeID = @EmployeeID)
AND (TaskTable.Task Date BETWEEN @EndDate AND @StartDate) ORDER BY TaskTable.TaskD ate DESC
Comment