Mike,
thanks for the reply. I just found out that the query didn't return anything because I forgot to assign the return value to the function itself......
However, I do now face another problem,
How to get the most recent month value, exp. if my records show March-June, I just need to have June records. So, the records need to be displayed as per the last month.
Thanks again.