Here is a great tool for formating SQL:
Instant SQL Formatter
That site saves my life at work — anytime I save/email a SQL, it goes through that formatter first.
Mail (will not be published) (required)
Notify me of follow-up comments by email.
Notify me of new posts by email.