How to get attendance of an employee in custom doctype?

I’ve created a custom salary doctype because of different kind of calculations of salary components. I’ve linked this with Employee doctype. Now, how can I get the total number of attendance (attendance count) of that employee for a particular month?

@Rahul_Singh

With the sql query or just dig into GitHub - frappe/hrms at version-14 codes and you might find some built in function who gets you the result you want.