+0
Can we say both
'Who did you visit last Sunday?'
'Whom did you visit last Sunday?'
+0
"whom" is the object form of "who". As Henry said, it is rather formal.

So you have:
"Who visited you last Sunday?" (the answer will be the subject of the sentence)
"My niece (did)."

but

"Whom did you visit last Sunday?" (the answer will be the direct object)
"(I visited) my niece."
Comments  
Yes.

The second option is more formal and "correct" in the eyes of some grammarians.

Henry
www.free-esl.com
 miriam's reply was promoted to an answer.