Welp Project - Step 8

Good morning, all

Working through this ‘Analyze Data with SQL - Welp Project’. I’m on step 8 and can’t figure out why this query I wrote isn’t returning any data. It isn’t bring up an error either. Here is what the question is looking for:

Sometimes on Welp, there are some old reviews that aren’t useful anymore.

Write a query using the WITH clause to select all the reviews that happened in 2020. JOIN the places to your WITH query to see a log of all reviews from 2020.

(This will use the WITH clause as well as the strftime() function. See if you can use Google to dig up some information about the function before take a look at the hint.)

Here is the code that I have to accomplish this:

image

Any insight would be greatly appreciated!

I think I may have figured out my own question. After reviewing the STRFTIME() query document I noticed that my ‘%y’ should be ‘%Y’. Once I fixed that I got results from my query.

image

3 Likes

Hello!
I had the same query to some point but I got different years on the results as shown in image 1, but then I got rid of the STRFTIME function and only used LIKE and it worked, but sill want someone to point the problem with first one.

You can try clear the rows above this code and run again.

Xin,
I am dealing with the same issue as Yassine, please what do you mean with “clear the row and run again”? Thanks in advance,

Hi, I mean clear all the rows above the code you are running. It might not make much sense technically but that’s how I fixed my code running problem.

Hi Xin,
Thanks a lot for the further explanation. I’ve got what you mean, However, instead to cancel up the previous rows, an option is to transform them as comments (using – ) and then the query does work!