Default Messing with mmssms.db

First off, I searched without success hence this post.
Second, if this is in the wrong forum will a mod please move to the correct. (If this is the case I apologize in advance)

With my job I spend a deal of time some days txting employees seeking someone to work, notifying them of company things, yadda yadda yadda.
Lately I've had a few part timers 'screw me over' by stating they didn't receive a text message or don't remember replying back to me. Because of this I've had to resort to making nightly copies of my mmssms.db. I've got a tasker job set up to move and send the file and get it on my desktop. That's not a problem. The problem is after I send the database I want to 'clear' my messages out but leave only certain ones. ie threads from friends or family but delete threads that sit cluttering my messaging and getting in the way. Through tasker I'm trying to run some SQL to pull only relevant data and move that to a txt file stored locally and then trying to clean out the database of unnecessary stuff. The problem I'm running into is that it's not clearing out everything I want it to. I want to keep my stuff intact but because of that I can't remove threads started by me sent to my employees. Confuzed yet?

sorta goes like this

Tasker kicks in. copies mmssms.db to desktop.
Run query and write data to txt
Run another query and remove unnecessary rows from mmssms.db

my query to delete the unwanted rows is this
Quote:
delete from sms where thread_id in (select _id from threads where _id in (select _id from canonical_addresses where address!="xxx-xxx-xxxx" and address!="xxxxxxxxxx"))
on the desktop this works great, I guess, but on the phone I'm just not getting the right results.
phew!
That being said, sorry for long windedness, am I doing this right? or am I going at it wrong?

any help would be much appreciated.

Thanks, in advance.