How do you quote a question in text?

I'm not sure exactly of your meaning but if you're writing a book and one of the characters asks a question, then you'd say something like

John then asked, "Where does the train go from?"

But if the charcacter is quoting someone else, then it would be

Jim said that John had asked where the train went from.