The codes I used is returning an error
Screen Link: Learn data science with Python and R projects
WHERE (SUBSTRING(hire_date, 1, 4) = '2017'
AND (LENGTH(first_name) = 5 OR (first_name)= 6)
I expected it to filter the hire_date based on 2017, but it keeps filtering 1985. Kindly help please!
Hey! Try changing the order of your query. In the exercise, you need to first find the length of
first_name, which is either
6. And only after that, the
hire_date should be in the year
Here is the query with correct order:
WHERE (LENGTH(first_name) = 5
OR LENGTH(first_name) = 6)
AND SUBSTRING(hire_date, 1, 4) = ‘2017’;