Sandra Bullock spent time in the same rehab facility where Jesse James is getting help ... but Sandra's stay was strictly for a movie role.

TMZ broke the story Jesse checked into Sierra Tucson in Arizona, a facility that treats sex, drug, alcohol and other disorders.

While preparing to shoot the movie, "28 Days" -- which was released in 2000 -- Sandra spent a few days at Sierra. Her role in the movie: A drunk who was given the choice ... rehab or jail.

More Sandra Bullock

ncG1vNJzZmivp6x7tbnZZ5qopV9nfXJ8jmlqaGthZMCiusOrmGaapaG5sK%2FKrGSrnZiWr26vzqelnpuknryvecmeqqydXZ%2BurrHSZpiroaqku6J50qKcq6qRYsG2r9KopWZqaGKxosXSZqSorpmaerO7y55krJ2oYq6lsMicq6KnnmQ%3D