My2004 Tahoe recently lost all electrical while I was driving but came right back on, the stereo clock reset and all dash lights came on. When I got home I looked under the hood and did not see any loose wires or frayed belts. The Tahoe started the next morning and I drove it 40 miles to work without issues but when I tried to start it to come home I had no power at all, I checked all of the wiring harnesses under the hood nothing looked wrong but when I tried again, the Tahoe started right up but again clock had reset. Any ideas on what is causing this.