Write a query to display the number of sales that were made in the last 40 months
Answers
Answered by
3
Explanation:
D Da tsagdf. hahaha hv ugVha ja hv cab
Answered by
1
SQL query to display the number of sales that were made in the last 40 months is:
- Method I - Using DATEADD
SELECT *
FROM TABLE_NAME
WHERE Date_Column >= DATEADD (MONTH, -40, GETDATE() )
- Method II where DATEADD isn't supported:
SELECT *
FROM TABLE_NAME
WHERE Date_Column >= DATE_ADD( NOW() , INTERVAL -40 MONTH )
Similar questions
English,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Science,
1 year ago