I have table called Client, which has the fields ClientFirstName, ClientLastName, Occupation and ClientDob. I want to get the age of the clients. I will be using the ClientDob field which has a date YEAR datatype.
I have done research and tried querying with this:
select ClientFirstName, ClientLastName, ClientDob, curdate(),
timestampdiff(YEAR, ClientDob, curdate()) as Age
from Client;
In my results, I get all fields, but the Age field has null values, what is the reason for this? Query was performed successfully but with null values, no errors shown in the response of the action. What should I check in order to try it again? The ClientDob has the YEAR datatype, and curdate shows year, month and day. Is this the reason why?