At least some of it was mud on that rainy day about 40 years ago when Van Houten wrestled with a sick cow, trying to give it medicine.

He had a bachelor's degree in accounting, but his family had owned an Escalon dairy for a while when he was younger. So the Ripon Christian High School graduate knew how to milk a cow, and he knew he didn't want to move to the Bay Area for an accounting job. Which is why he found himself milking cows instead of balancing ledgers.

Standing knee-deep in filth, he decided to go back to school to get his master's degree, Van Houten, now 64 and still living in Escalon, recalled right before his last day as San Joaquin County's auditor-controller, an elected office he's held for 22 years, longer than anyone else in county history.

"I thought there would be more opportunity if I had a master's ... to at least get me out of this manure pile," he said. He went back to school, but before long, a job opened up at the Auditor-Controller's Office. He got the job and started work in 1974. In 1990, he was elected to be in charge of the office, a mostly behind-the-scenes but integral piece of the operation of county government.

It oversees and reports on the county's finances, handles payroll for some 7,000 government workers and plays a part in the conversion of property value to tax revenue that is the life's blood of county government.

"Our job is internal control," he said. "We act as a review agent over other departments in various ways."

And it's something Van Houten has done well, said peers and those who have worked with him in the county over the decades, who also describe him as a kind man with a keen sense of humor.

Van Houten's last day in office was Friday. He had said it would be his last term in office when he drew no challengers for the seat in 2010. The term ends in 2014, and it will be up to the Board of Supervisors what to do next to fill the vacancy, according to county officials.

The board filled a vacancy in another elected office after conducting a series of public interviews that ended with the appointment of Assessor-Recorder-County Clerk Ken Blakemore in 2009. Van Houten hasn't faced competition at the polls since 1990, when it was a bout between two assistant auditor-controllers.

With the Treasurer-Tax Collector's Office, Van Houten's and Blakemore's offices work in concert to provide the property tax revenue used to pay for a wide array of services provided by county government, municipal services performed by city government and functions of special districts, including those fighting fires and flooding.

One office assesses the value of the property, Van Houten's office sets the rate, and the third office collects the taxes. It happens every year. And the process helps keep it both fair and accurate, officials said.

Treasurer-Tax Collector Shabbir Khan heads the third of the three offices, but he also used to work for Van Houten in the Auditor-Controller's Office. Khan describes Van Houten as conscientious, good to work for and somebody who had the taxpayer in mind when doing his work. "He's always been that way."

From 1850, the county auditor also had been the county recorder. By the mid- to late 20th century, the roles split, and the Auditor-Controller's Office was formed. Nobody has served as county auditor longer than Van Houten, according to records from the Stockton-San Joaquin County Public Library, San Joaquin County Historical Society and the auditor's office.

Van Houten headed the office as it entered the digital age, from the installation of the department's first computer network to more recent upgrades.

Among other things, the new technology has helped the office handle budget cuts in recent years, Van Houten said.

The office now contracts out more of the audits it is required to perform by law, but it has eliminated its internal-audits division.

It means discretionary audits of county departments have ceased.

Van Houten said the audits are something he'd like to see come back. "Because there are things that need to be checked, and we have had cases in the past where we have caught people."

In 1992, a county audit led to a criminal investigation into a clerk at the District Attorney's Office accused of embezzling money paid as restitution to victims of crime. In 1998, an audit looked into the Public Administrator's Office, which handles the estates of the dead when nobody else is qualified to do so. The books were "a mess," Van Houten said. The Sheriff's Office would later take over the public administrator role.

In 2005, an audit found faults with bookkeeping in the Probation Department.

Van Houten was also active in the California State Association of County Auditors. "He always did his homework, ... (and) he always represented San Joaquin County well," said Debbi Bautista, the clerk-auditor-controller of Tuolumne County.

At one of the gatherings of the group, Van Houten showed his compassionate side, she said. There was a man on the street in some kind of distress, and Van Houten was the one who stopped to help.

In San Joaquin County, Van Houten has been involved in his church and has served terms on boards overseeing the United Way, Ripon Christian High School and Bethany Home Society, a Ripon-based charity providing care for the elderly.

One reason he is retiring is to take care of his wife, Valerie. She needs a liver transplant and requires frequent trips to doctor's appointments while she waits for her turn to receive a liver.

Van Houten has a son and two daughters. A third daughter, Alison Freeseha, was shot to death at a party in Sacramento County in 2009. Two assailants have since been convicted and sentenced to life without possibility of parole, Van Houten said.

In retirement, Van Houten sees himself working on cars or helping with family projects. He also knows of organizations where he could volunteer, he said.