Yes, that produces the correct result, thanks.
I like Greg's (and the link that Eric posted) because it solves it in one SELECT statement. I realize that sometimes an "if one condition, run this select....otherwise, run this select" is necessary, but in this case I think one SELECT is preferable.
Thanks for playing, everyone! OK, that was too easy, have to come up with a tougher one :)