fuel guage works on occasion??

Also, if you haven't already, check the sending wire that comes up in the middle back area of the trunk. Mine was a blue wire and someone had spliced it before and had a bad connection. Isn't there also a ground connection to the sending unit?