LibreOffice Base -Queries...

I have a database Reactors_Videos and three of the fields are:

No (Field Type = Number (Numeric)
First (Field Type = Date (DATE)
Last (Field Type = Date (DATE)

I successfully created a Query to display the total number of Reactions.

This Query takes the form

SELECT SUM( "No" ) FROM "Reactor_Videos Table 1"

I am now trying to create a Query which will display the number of reactions between any two dates but failing miserably

Most of them return the error : SQL Status: HY000 Error code: 1000 Syntax error in SQL statement" and an internet search reveals that this error is returned for any number of reasons, none of which are helpful to me (perhaps because of my lack of knowledge)

My latest attempt was

SELECT SUM( "No" ) FROM "Reactor_Videos Table 1" HAVING ( ( COUNT( "First" ) = 1 / 12 / 20 AND COUNT( "Last" ) = 31 / 12 / 20 ) )

This saved without any error messages but running the query results in no output

As will be apparent, my knowledge of the SQL language is minimal at best and any help members are able to offer will be very welcome.

Zed

Hi zed,

you have to set the filter in subquery.
Could be this is what you want to get:

SELECT SUM( "No" ) FROM (SELECT * FROM "Reactor_Videos Table 1" WHERE
"First" >= '2020-12-01' AND "Last" <= '2020-12-31' )

You have to set the dates SQL-like in format 'YYYY-MM-DD'

Regards

Robert