The paper is concerned with the problem of automatic detection and correction of inconsistent or out of range data in a general
process of statistical data collecting. Under such circumstances, errors are usually detected by formulating a set of rules
which the data records must respect in order to be declared correct. As a first relevant point, the set of rules itself is
checked for inconsistency or redundancy, by encoding it into a propositional logic formula, and solving a sequence of Satisfiability
problems. This set of rules is then used to detect erroneous data. In the subsequent phase of error correction, the above
set of rules must be satisfied, but the erroneous records should be altered as little as possible, and frequency distributions
of correct data should be preserved. As a second relevant point, error correction is modeled by encoding the rules with linear
inequalities, and solving a sequence of set covering problems. The proposed procedure is tested on a real-world case of Census.