/*ATTACH "C:\Users\tom\Kalender\Kalender\Rettung.sqlite" AS rettung;*/ INSERT INTO rettung.cal_alarms SELECT cal_alarms.cal_id,cal_alarms.item_id,cal_alarms.recurrence_id,cal_alarms.recurrence_id_tz,cal_alarms.icalString from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_alarms ON cal_events.id = cal_alarms.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_attachments SELECT cal_attachments.item_id,cal_attachments.cal_id,cal_attachments.recurrence_id, cal_attachments.recurrence_id_tz,cal_attachments.icalString from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_attachments ON cal_events.id = cal_attachments.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_attendees SELECT cal_attendees.item_id,cal_attendees.recurrence_id,cal_attendees.recurrence_id_tz,cal_attendees.cal_id,cal_attendees.icalString from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_attendees ON cal_events.id = cal_attendees.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_events SELECT cal_events.cal_id,cal_events.id,cal_events.time_created,cal_events.last_modified,cal_events.title,cal_events.priority,cal_events.privacy,cal_events.ical_status,cal_events.flags, cal_events.event_start,cal_events.event_end,cal_events.event_stamp,cal_events.event_start_tz,cal_events.event_end_tz,cal_events.recurrence_id,cal_events.recurrence_id_tz,cal_events.alarm_last_ack, cal_events.offline_journal from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_metadata SELECT cal_metadata.cal_id,cal_metadata.item_id,cal_metadata.value from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_metadata ON cal_events.id = cal_metadata.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_properties SELECT cal_properties.item_id,cal_properties.key,cal_properties.value,cal_properties.recurrence_id, cal_properties.recurrence_id_tz,cal_properties.cal_id from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_properties ON cal_events.id = cal_properties.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_recurrence SELECT cal_recurrence.item_id,cal_recurrence.cal_id,cal_recurrence.icalString from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_relations SELECT cal_relations.cal_id,cal_relations.item_id,cal_relations.recurrence_id,cal_relations.recurrence_id_tz, cal_relations.icalString from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_relations ON cal_events.id = cal_relations.item_id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) AND (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; INSERT INTO rettung.cal_todos SELECT cal_todos.cal_id,cal_todos.id,cal_todos.time_created,cal_todos.last_modified,cal_todos.title, cal_todos.priority,cal_todos.privacy,cal_todos.ical_status,cal_todos.flags,cal_todos.todo_entry,cal_todos.todo_due, cal_todos.todo_completed,cal_todos.todo_complete,cal_todos.todo_entry_tz,cal_todos.todo_due_tz, cal_todos.todo_completed_tz,cal_todos.recurrence_id,cal_todos.recurrence_id_tz,cal_todos.alarm_last_ack, cal_todos.todo_stamp,cal_todos.offline_journal from cal_events LEFT JOIN cal_recurrence ON cal_events.id = cal_recurrence.item_id LEFT JOIN cal_todos ON cal_events.id = cal_todos.id WHERE ( cal_events.event_start BETWEEN (strftime('%s','2021-02-28 23:59:59')*1E6+3600*1E6) and (strftime('%s','2021-03-31 23:59:59')*1E6+3600*1E6)) group by cal_events.id; /*DETACH DATABASE 'rettung';*/