It will drive in second because you're commanding it to and it listens. In D it won't because it's not sure when to shift.
Has all the makings of a defective VSS. I'd go to your local auto parts stores and have the codes pulled. Bring the codes back here and don't let them sell you anything. Just let us see the codes and we can go from there.
RP
Zach