I have two tables,
first one is "tbl_login" which contains two columns "userid' and "name" (both are varchar fields)
second one is "tbl_leave" which conatins three columns "userid","fromdate","duration" (all are varchar fields)
tbl_login.userid=tbl_leave.userid
for example
tbl_login :
userid name
001 abcd
002 defc
tbl_leave
userid fromdate duration
-----------------------------------------------------------------------------------
001 2011/03/08 2 days
002 2011/03/28 5 days
i want a query to display like this
here name of user with id 001 have on leave from 08/03/2011 for 2days
so when i login on 09/03/2011,it shos like this following
userid name status
-------------------------------------------------------------------------------------
001 abcd absent
002 defc present
because "abcd" is on leave and defc is on not leave
and when today=29/03/2011
its will show like
userid name status
-------------------------------------------------------------------------------------
001 abcd present
002 defc absent
because defc is on leave from 28/03/2011 for 5 days
ALL THE FIELDS ARE VARCHAR FIELDS
i dont know if its possible or not,if it is possible
please help me