2004 olds alero wont start in park does in neutral on 2004 Oldsmobile Alero

If I put it in neutral it will start sometime if park fails . If that doesnt work I take it from park to 3rd a couple of times or jiggle the gear shift ( it is automatic) it will start.If the car is warm from heat or sun, it almost always does not start.We have changed the neutral saftey switch. Did not fix the problem

1 answer 2 comments
poss trans range sensor is going bad
Thank you we will look into that we just put a new solenoid in it and it worked fine for two days and then it wouldnt start again so that wasnt it . thanks again
Thank you we will look into that we just put a new solenoid in it and it worked fine for two days and then it wouldnt start again so that wasnt it . thanks again what is a trans sensor and where is it located