SQL code does not work wanted an explanation of why the error in the code?

0

I got these two tables in one exercise, but my code is not working and I wanted to know if anyone could explain it to me. I have to submit all the orders created in the last 10 days.

My code:

Select id-order, createdDate
From Date
Where Date = 'createDate' in <10 days

It just does not work.

    
asked by anonymous 24.02.2018 / 23:14

1 answer

0

Apparently what you need to do is something like this:

SELECT 
    ID-ORDER, CREATEDDATE
FROM
    ORDER
WHERE 
    DATEDIFF(DAY,CREATEDDATE,GETDATE()) < 10
    
24.02.2018 / 23:21