The switch works intermittently
That sounds like a broken wire in the driver's door wire loom, typically near the barrel connector. The easiest way to check/repair is to remove the driver's door to get easy access to the wires, which is actually very easy to accomplish.
1.Open the driver's window to give you something to hold onto while removing the door
2, Pry the small plastic cap off the top of the barrel connector
3. Completely unscrew the 10MM bolt which you'll find under the cap, which will separate the 2 halves of the barrel connector
4. Remove the four 13MM bolts which hold the door hinges to the "A" pillar and remove the door (have a helper support the door, which can be balanced on a floor jack on a piece of 2x4)
5. Cut the strap that secures the rubber boot to the barrel connector and peel the boot back
6. Carefully examine each wire to check for signs of breakage and repair
7. A wire tie can be used to replace the boot strap you cut off
Free wiring diagrams can be found below under diagrams in the Auto Repair Reference Center:
https://search.ebscohost.com/Login.aspx?lp=login.asp&ref=https://www.google.com/&authtype=ip,uid
User ID = s8921298
Password = password