0

i write query like

select * from pm_task_user_work LEFT JOIN pm_task_allotment ON pm_task_allotment.task_allotment_id=pm_task_user_work.task_allotment_id where pm_task_user_work.project_id='19' and (Select str_to_date(pm_task_user_work.task_user_work_link_time,'%Y-%m-%d') as MyDate from pm_task_user_work) BETWEEN '2009-12-15' AND '2009-12-15' order by pm_task_user_work.project_module_id,pm_task_user_work.task_user_work_link_follow

It gives me Subquery returns more than 1 row

------------
2> SELECT pm_task_user_work . * , str_to_date( pm_task_user_work.task_user_work_link_time, '%Y-%m-%d' ) AS MyDate
FROM pm_task_user_work
LEFT JOIN pm_task_allotment ON pm_task_allotment.task_allotment_id = pm_task_user_work.task_allotment_id
WHERE pm_task_user_work.project_id = '19'
ORDER BY pm_task_user_work.project_module_id, pm_task_user_work.task_user_work_link_follow

but when i tried to find date between mydate it says unknown column??

how to select date ?

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by baki100
0

try this

SELECT pm_task_user_work . * , str_to_date( pm_task_user_work.task_user_work_link_time, '%Y-%m-%d' ) AS MyDate
FROM pm_task_user_work, pm_task_allotment
WHERE pm_task_allotment.task_allotment_id = pm_task_user_work.task_allotment_id
AND pm_task_user_work.project_id = '19'
ORDER BY pm_task_user_work.project_module_id, pm_task_user_work.task_user_work_link_follow
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.