Having problem with getYear()

Having problem with getYear()

Hi,

I want to define a function that returns the no. of row count where the year in A_Date (Date field) is equals to the current year. I tried using getYear() but upon saving, I'm getting undefined and null. Is there something wrong with my codes?

Here's my code :

  1. int Calculate.AttendanceTotal(int empID)
  2. {
  3.     yr = zoho.currentdate.getYear();
  4.     c_VL = Attendance[Employee == input.empID && A_Date.getYear() == yr].count();

  5.     return c_VL;
  6. }