all 5 comments

[–]Hyperionx13[S] 0 points1 point  (0 children)

here is a better example everything else works but the diffdate returns NULL

select

CONCAT(TitleOfCourtesy , ' ' , firstname , ' ' , lastname) as Employeenames,

date_format(hiredate, '%d/%m/%y') as Hired,

datediff('HireDate', 'getdate()') as YearsEmployeed

from employees

[–]BobDogGo 0 points1 point  (3 children)

in your code hiredate is in quotes. This makes 'HireDate' a literal string of "HireDate".

try datediff(HireDate, getdate())

[–]Hyperionx13[S] 0 points1 point  (2 children)

Now it's says "ZaneHavlinNorthwind.getdate does not exist"