string query = "select ad.student_id,ad.full_name from add_student ad inner join billing b on ad.student_id = b.student_id where month (b.fee_of_month) = month(#"+DateTime.Now.ToShortDateString()+"#) and year(b.fee_of_month)= year(#"+DateTime.Now.ToShortDateString()+"#)";
I am using above query to retrieve record of that students who have paid fees of this month. And this query is working fine.
But I want query to retrieve record of that students who have not paid their fees.
If I use query like below then it will not records as expected. Please suggest me query how can I achieve my task. I will be very thankful of yours.
string query = "select ad.student_id,ad.full_name from add_student ad inner join billing b on ad.student_id = b.student_id where month (b.fee_of_month) <> month(#"+DateTime.Now.ToShortDateString()+"#) and year(b.fee_of_month)= year(#"+DateTime.Now.ToShortDateString()+"#)";