The Error in Query is
You are making use of a join query so u have to make a common key of t1 and t2 in on condition
example.
select t1.*,t2.* FROM (
SELECT datefrom AS datefrm, *
FROM LM_TblLeaveapply
WHERE datefrom between '2010-10-19' and (select Max(datefrom) from LM_TblLeaveapply)
) t1
FULL OUTER JOIN
(
SELECT dateto AS datto, *
FROM LM_TblLeaveapply
where dateto between '2010-10-19' and (select Max(dateto) from LM_TblLeaveapply)
) t2 on t1.empid = t2.empid
This is to run this query. but still dont know what u want as result.