Re: [weewx-user] SQLite3 calculate an item

2024-07-31 Thread Craig Young
Thank you heaps Walt .. exactly what I was looking for. Craig On Wednesday, July 31, 2024 at 11:12:27 PM UTC+12 wfs...@gmail.com wrote: > You can do this with the sqlite3 utility program. I believe the sql > update statement you want is: > > update archive set signal4 = case when outtemp < 10.

Re: [weewx-user] SQLite3 calculate an item

2024-07-31 Thread wfs...@gmail.com
You can do this with the sqlite3 utility program. I believe the sql update statement you want is: update archive set signal4 = case when outtemp < 10.0 then 1.0 else 0.0 end; I tried it on a copy of my database, see attached. Walt On Tuesday, July 30, 2024 at 7:03:20 PM UTC-5 Craig Young wrot

Re: [weewx-user] SQLite3 calculate an item

2024-07-30 Thread Craig Young
Good advice Peter .. I will give this a try. Craig On Wednesday, July 31, 2024 at 11:18:26 AM UTC+12 p q wrote: > if I were doing it, I would use SQLite to execute the queries and then I > would check my work with DB Browser. > > I think you may have misunderstood my backup comment. I would pra

Re: [weewx-user] SQLite3 calculate an item

2024-07-30 Thread p q
if I were doing it, I would use SQLite to execute the queries and then I would check my work with DB Browser. I think you may have misunderstood my backup comment. I would practice on a copy of my database. Once I had the queries correct, then I'd stop Weewx, make another backup of the database to

Re: [weewx-user] SQLite3 calculate an item

2024-07-30 Thread Craig Young
Absolutely, I would backup the database first .. your idea of using a two pass method would work .. would I do that with the weewx database utility or some linux based sql app like DB Browser for SQLite? On Wednesday, July 31, 2024 at 10:45:47 AM UTC+12 p q wrote: > Do yourself a favor and make

Re: [weewx-user] SQLite3 calculate an item

2024-07-30 Thread p q
Do yourself a favor and make a backup copy. Test out whatever method you chose on the copy. As to the query, I think you could fill the Signal field with 0.0 and then do an UPDATE SQL query where outTemp > 10.0. You can find the SQL syntax online. On Tue, Jul 30, 2024 at 3:30 PM Craig Young wrot