Hi all, I have a table that captures printer page counters,the system scans at a given time and every time it does this it feeds the database with the information. Now what i want is, as it does the update of the page count, it should first get the difference between the previous reading and the current reading and the difference is what it should show. How can i achieve this in a tsql statement? Thanks in advance Best regards Sacky
You can assign and use the value stored in the same column. Something like: SET page_count=page_count+@valuefromprinter this would read the value, add the value in the variable, then update the column.