I am trying to get a Query to post a sum of income amounts between two given date ranges. The table used has a _date field and an _amount field, of which I've been trying via SQL unsuccessfully to get to sum up my month's earnings.
Below is the SQL code I'm using, along with the error I'm receiving. My understanding of SQL select statements is slightly above beginner, but probably under that of a novice by a long shot. Aggregate functions (HAVING, GROUP BY, etc..) are a weak point in my comprehension of the language.
Code: Select all
SELECT SUM( '_amount' ) AS "Total", '_date' AS "Date" FROM "TableIncome" WHERE '_date' BETWEEN ["Enter Start Date"] AND ["ENTER END DATE"]
Code: Select all
SQL Status: HY000
Error code: 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE
Any SQL hackers that are good with HSQL, I'd appreciate your help. This simple query will help me greatly with getting tax information handled.
Thanks