0

I've looked everywhere including the MySQL website but still does not seem to work for me.

From a table I have to get Name,Email and the Age from a calculation. (I have DOB).

So far I have tried.

SELECT Name,DOB,CURDATE(), TIMESTAMPDIFF(YEAR,DOB,CURDATE()) AS Age, FROM Editor;

Keeps giving me Null for the Age column, can anyone help please?

bob9123
  • 725
  • 1
  • 9
  • 31
  • possible duplicate of [How to get an age from a D.O.B field in MySQL?](http://stackoverflow.com/questions/2533890/how-to-get-an-age-from-a-d-o-b-field-in-mysql) – swapnesh Dec 03 '14 at 17:17
  • Tried that, was giving errors. – bob9123 Dec 03 '14 at 17:18
  • what data are you seeing for the DOB and CURDATE() columns where the the age is null? are they in the proper format? is the DOB null in any of the rows? Also, what is the datatype for your DOB column? – Anil Dec 03 '14 at 18:24
  • The linked question's got several answers. Which one was giving you errors? Why didn't you try the others? – Andriy M Dec 04 '14 at 07:47

0 Answers0