-1

I'm trying to write an SQL that calculates the total revenue from 1/2/2017 to 12/30/2017, but it does not recognise the second date. It says invalid position.

SELECT SUM(orderRevenue)
  AS "Total Revenue for 2017"
FROM transactionid
WHERE TransactionDate BETWEEN DATE '1/2/2017' AND DATE '12/30/2017';
Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

1

You just need to use the correct date format -

SELECT SUM(orderRevenue) AS `Total Revenue for 2017`
FROM transactionid
WHERE TransactionDate BETWEEN '2017-01-02' AND '2017-12-30';
user1191247
  • 10,808
  • 2
  • 22
  • 32