If I understand correctly, you need to fetch a row for in and for out and to calculate the difference?
If so, perhaps something like:
SELECT DATEDIFF(hour, out. TimesInOut, in.TimesInOut)
FROM Log_Attendance in,
Log_Attendance out
WHERE in.enrollnumber = out.enrollnumber
AND in.inoutmode = 0
AND out.inoutmode = 1
AND in.DateAttendance = out.DateAttendance
...
Of course that's not the whole logic but it'll jopefully get you started...