INSERT INTO time_entry( EntryCreated, Duration, Description, CategoryID, EntryDate, CreatorID, UserID ) VALUES( strftime('%s', 'now'), #Duration#, #Description#, #Category.ID#, #ReportDate, typeHandler=DateTime#, #CreatorUserName#, #Username# ) select LAST_INSERT_ROWID() as value DELETE FROM time_entry WHERE EntryID = #value# UPDATE time_entry SET Duration = #Duration#, Description = #Description#, CategoryID = #Category.ID#, EntryDate = #ReportDate, typeHandler=DateTime#, UserID = #Username# WHERE EntryID = #ID#