A quibus hoc dictum est?
1- What was said by them?
2- By whom was this said?
Which is correct?
Why?
1- What was said by them?
2- By whom was this said?
Which is correct?
Why?
Quid ab eis dictum est?The second one is correct. Ā quibus is the interrogative pronoun, in the ablative form with ā/ab, which is how personal agents are expressed in a passive sentence, as this is (dictum est). Hoc is a demonstrative pronoun and can't be an interrogative.
Your first example would be: Quid ab eīs dictum est?
With dictum est, yes.Quid ab eis dictum est?
What was said by them?
Is quid the only interrogative that will work here?