hi am beginner of SQL ,
i hav some doubt in SQL Query Between Command..
i want to calculate two dates using between command..
example of the Query is:
SELECT LI.EmpId,EOS.Em p_Name,DS.Descr iption,SUM(conv ert(int, DateDiff (Day,'10/03/2007','11/11/2007'))+1)
as Leave,LS.NoOfLe aves, (LS.NoOfLeaves -SUM((convert(in t, DateDiff (Day,'10/03/2007' , '11/10/2007'))+1)))
as Balance FROM
LEAVEINFO LI,EMPLOYEEOFFI CIALSETUP as EOS,DESGSETUP as DS, LEAVESETUP LS
WHERE(LI.EmpId= EOS.EmpId AND EOS.DESIGCODE=D S.DESGCODE AND DS.DESGCODE='00 7 ' AND EOS.EmpId='E000 2' ) AND
LS.NOOFLEAVES=( select NoofLeaves From LeaveSetup where EnteredDate=(se lect Max(EnteredDate ) from LeaveSetup as e
where EnteredDate=e.E nteredDate))
GROUP BY LS.NOOFLEAVES,L I.EmpId,EOS.Emp _Name,DS.Descri ption
i hav some doubt in SQL Query Between Command..
i want to calculate two dates using between command..
example of the Query is:
SELECT LI.EmpId,EOS.Em p_Name,DS.Descr iption,SUM(conv ert(int, DateDiff (Day,'10/03/2007','11/11/2007'))+1)
as Leave,LS.NoOfLe aves, (LS.NoOfLeaves -SUM((convert(in t, DateDiff (Day,'10/03/2007' , '11/10/2007'))+1)))
as Balance FROM
LEAVEINFO LI,EMPLOYEEOFFI CIALSETUP as EOS,DESGSETUP as DS, LEAVESETUP LS
WHERE(LI.EmpId= EOS.EmpId AND EOS.DESIGCODE=D S.DESGCODE AND DS.DESGCODE='00 7 ' AND EOS.EmpId='E000 2' ) AND
LS.NOOFLEAVES=( select NoofLeaves From LeaveSetup where EnteredDate=(se lect Max(EnteredDate ) from LeaveSetup as e
where EnteredDate=e.E nteredDate))
GROUP BY LS.NOOFLEAVES,L I.EmpId,EOS.Emp _Name,DS.Descri ption
Comment