Seems like this is a common issue with Nissans; I had the same thing with my '89 240SX (the car before my current '98 Altima). Although it would only stop working when the speedometer also wasn't working (would show zero). Never got it fixed, as it only happened occasionally and I could always tell my approximate speed by the tach; sold the car a year or so after.