create procedure GetScheduleGivenDay @GivenDay datetime as
select task.title, task.detail, task.begintime, task.notifytime, task.neednotify, task.finished, tasktype.typetitle, priority.prioritytitle from tasktype INNER JOIN task ON Task.Type.TaskType_ID=task.type INNER JOIN priority ON task.priority=priority.priority_ID where (DAY(@GivenDay)=DAY(task.BeginTime)) AND (MONTH(@GivenDay)=MONTH(task.BeginTime)) AND (YEAR(@GivenDay)=YEAR(task.BeginTime)) RETURN GO