Detecting Deep Impact There have been several accounts in media articles of asteroid near misses, many describe that the asteroid was not seen before the near miss.

After reading the question and answer to How can we tell if the asteroid 2013 TV135 will hit Earth in 2032?, where it was discussed about determining the orbits of known asteroids.

The question here is what is the furthest practical distance that a previously undetected asteroid, capable of an extinction level event, can be observed to have a trajectory that will result in a collision course with Earth?
Something to consider might be a large very dark (low albedo) asteroid.  I would say it is quite possible a large dark asteroid (e.g. P-type) "could" be headed for us, and we would not know it until it hit us (e.g. distance 0).  I think you are asking for the closest distance.  It appears the main method of detecting asteriods is with telescopes, but we are starting to scan the skies in infrared too.  Hopefully infrared will reveal these darker asteriods better.  Sources for further research include:

http://en.wikipedia.org/wiki/P-type_asteroid

http://www.space.com/3126-asteroids-data-sheet.html

http://www.nbcnews.com/science/space/how-we-scan-solar-system-find-dangerous-asteroids-f8C11480423

For the furthest distance, that question is trickier.  It would largely depend on what is considered an asteroid, for example, if we consider Pluto to be an asteroid, we can at least detect very large asteroids out to the distance of Pluto, and we could track its path and see if it were on a collision course with earth.

On average, it is said that we have already detected most of the globally threatening asteroids and it does not appear we are in immediate danger.  Still, I'd say we need to stay on the lookout, and especially look out in infrared to detect any dark asteroids we may have missed :-).

Summary: 


Closest distance before large threatening asteriod detection: 0 (e.g. upon impact)
Furthest distance before large threatening asteroid detection: Beyond the orbit of Pluto (and most asteroids tracked are in the asteroid belt between Mars and Jupiter)