I assume that you are using this repo to leverage your portfolio, as this is what the books use them for. If this is true then any repo would lower your duration, but the 2 year would lower duration further than an overnight repo holding all else equal.
For example:
port = 100,000; Duration=10
repo = 25,000; overnight Duration=0; 2 year duration=2
leveraged portfolio mkt value is 125,000
new duration using overnight repo is 10*(100/125) + 0(25/125) = 8
new duration using 2 year repo is 10*(100/125) + (-2)*(25/125) = 7.6
Does that answer your question?