Bingo!

Thank you for your help.

Neil


On Saturday, 11 January 2020 14:46:36 UTC, Thomas Keffer wrote:
>
> It's actually much simpler. The field 'dateTime' is already in unix epoch 
> time. So, you want
>
> *  delete from archive where dateTime>1578739140 and dateTime<1578741360;*
>
> Then rebuild the daily summaries.
>
> -tk
>
> On Sat, Jan 11, 2020 at 7:29 AM Neil S <[email protected] <javascript:>> 
> wrote:
>
>> I am trying to delete data between two time points as it is erroneous (I 
>> updated and for a short period the station type was reset to simulate).
>>
>> The time points are 11/1/20 at 10:39:00 and 11:16:00 (so I think I have 
>> the right unixepoch timestamps)
>>
>> I have worked out how to delete data that is older or newer than any one 
>> point but not between. In theory the following should work 
>>
>> *sqlite3 /var/lib/weewx/weewx.sdb*
>>
>> *delete from archive where datetime(dateTime,'unixepoch','localtime') 
>> BETWEEN '1578739140' AND '1578741360';*
>> *.exit*
>>
>>
>> but it doesnt and just appears to delete all data up to the last time 
>> stamp. All historic data seems to have been deleted (including all the NOAA 
>> data).
>>
>> I have also tried 
>>
>> *sqlite3 /var/lib/weewx/weewx.sdb*
>> *delete from archive where 
>> (datetime(dateTime,'unixepoch','localtime')>1578739140) AND *
>> *(datetime(dateTime,'unixepoch','localtime')<**1578741360);*
>> *.exit*
>>
>>
>> Strangely the database size seems to be the same though - so is it just a 
>> case of me panicking that I am loosing data and I need to wait for tables 
>> to be rebuilt?
>>
>> TIA
>> Neil
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/0f6dc72d-4366-4e63-922a-bde2275822b7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/0f6dc72d-4366-4e63-922a-bde2275822b7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/487e0a08-3686-4137-ab24-dcc1508741af%40googlegroups.com.

Reply via email to