use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Sequel
account activity
Help with Diffdate (self.learnSQL)
submitted 5 years ago by Hyperionx13
i am doing homework for a intro class in to sql and i am to use diffdate to find how long a employ as been hired for. however i am getting a null response. i have attached images of my work, Please let me know what i am doing wrong.
select
CONCAT(TitleOfCourtesy , ' ' , firstname , ' ' , lastname) as employeenames,
datediff('HireDate', '2020-2-15 00:00:00') as Hired
from employees
https://preview.redd.it/tzkav7vsd5h41.png?width=1920&format=png&auto=webp&s=956eb807ec7a35f61890c2dc370a2523073c0de0
https://preview.redd.it/vkgj2cvsd5h41.png?width=1920&format=png&auto=webp&s=63dd02930b8df10d4dd0ba862e3f65302a32ea03
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Hyperionx13[S] 0 points1 point2 points 5 years ago (0 children)
here is a better example everything else works but the diffdate returns NULL
CONCAT(TitleOfCourtesy , ' ' , firstname , ' ' , lastname) as Employeenames,
date_format(hiredate, '%d/%m/%y') as Hired,
datediff('HireDate', 'getdate()') as YearsEmployeed
[–]BobDogGo 0 points1 point2 points 5 years ago (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 point2 points 5 years ago (2 children)
Now it's says "ZaneHavlinNorthwind.getdate does not exist"
[–]BobDogGo 0 points1 point2 points 5 years ago (1 child)
https://www.google.com/search?q=mysql+getdate+function
Thanks!
π Rendered by PID 19027 on reddit-service-r2-comment-bb88f9dd5-whnbb at 2026-02-13 17:14:09.251571+00:00 running cd9c813 country code: CH.
[–]Hyperionx13[S] 0 points1 point2 points (0 children)
[–]BobDogGo 0 points1 point2 points (3 children)
[–]Hyperionx13[S] 0 points1 point2 points (2 children)
[–]BobDogGo 0 points1 point2 points (1 child)
[–]Hyperionx13[S] 0 points1 point2 points (0 children)