I have following two tables in the database. One table is person table and other table is Entry table, entry table records the persons entrance to a department
Person Table
Person
Person_ID Person_NIC Person_Name Person_Last_Name Person_Age State
1 121212 ABC BCD 12 ACTIVE
2 212121 ABB BBB 13 NONACTIVE
3 111111 BBB CCC 14 ACTIVE
Entry Table
ENTRY
Entry_ID Person_ID Entry_Escort Entry_Date
1 1 David 20121210
2 1 David 20130110
3 1 David 20130111
4 1 David 20130112
5 1 David 20130113
6 2 David 20121210
7 2 David 20130110
8 2 David 20130111
9 2 David 20130112
10 2 David 20130113
I have to write sql for following scenario. I need to find Last Entry date for persons how are non active in the database for the month of January. could anybody help me with query. thanks in advance for any help.
This should be as as easy as this: