Need some help writing an SQL statement.
Posted on 2011-03-08
I use Spiceworks on my network at work, and I need an update sql statment that will replace the existing ID file anywhere there are ticket ID numbers with a number that is 10109000 less than what is there. I foolishly thought setting a number that was the date was a good way to go for the helpdesk tickets. I was wrong. I know that purchases, comments and tickets all the use and link tickets together by their ID, and I've looked through the other tables, but I probably missed something. It's been awhile since I wrote any SQL and my guess is that someone can post it quickly for me.
So, in a nutshell I need to replace the ticket ID with a number that is 10109000 less than what exists now. For example:
ID = 10110015 would be changed to 1015. (10110015 - 10109000) = 1015