Page 1 of 1

Extreme Block 1970

Posted: Mon Mar 28, 2022 11:20 am
by Saszalez
Hello. I have installed the "Extremes Block", and when looking at the list, the first minimum value of any of the variables is 0, registered on January 1, 1970. There is no value for that date; it is always 0. How can it be corrected?

Re: Extreme Block 1970

Posted: Mon Mar 28, 2022 12:49 pm
by davidefa
You can remove this erroneous data ( via the meteotemplate control panel ) database -> edit data and database -> edit data extra sensors, remove any data of 01/01/1970 ( it should be only one ).
If you have several of these wrong data it could be faster to remove them via phpmyadmin ( accessibkle via your hosting provider's control panel )

Re: Extreme Block 1970

Posted: Mon Mar 28, 2022 6:14 pm
by Saszalez
I have looked where you have told me, and there is no data. Therefore, I cannot delete anything.

Re: Extreme Block 1970

Posted: Mon Mar 28, 2022 9:17 pm
by davidefa
I see.
To pinpoint the problem you can try executing the following query ( in phpmyadmin ):

Code: Select all

SELECT DayAvg, DATETIME
			FROM (
				SELECT DATETIME, AVG(T) AS DayAvg
				FROM alldata
				GROUP BY YEAR(DATETIME), MONTH(DATETIME), DAY(DATETIME)
				ORDER BY DATETIME
			) AS DailyMaxTable
			ORDER BY DayAvg
			LIMIT 10
This is the same query that is executed to retrieve minimum average temperature:

extremes01.png
extremes01.png (26.66 KiB) Viewed 5149 times

Re: Extreme Block 1970

Posted: Mon Mar 28, 2022 10:26 pm
by Saszalez
If I run the code I get the following:

Re: Extreme Block 1970

Posted: Tue Mar 29, 2022 9:28 am
by davidefa
I'd say you have a record on 1970-01-01
This query ( in phpmyadmin ) should return exactly 1 result:

Code: Select all

SELECT * FROM `alldata` WHERE DateTime <= '2020-01-01 00:00:00'
And this query should delete it:

Code: Select all

DELETE FROM `alldata` WHERE DateTime <= '2020-01-01 00:00:00'
P.S.
Is always a good idea to make a backup of the database before executing these ( potentially destructive ) queries