Think big picture. It's less than one day, and time flies when you're having fun. If you have remained sober all these days in a row what's one more? Think of how you'll feel if you don't drink vs. how you'll feel if you slip.
Remind yourself that if you stay straight no one will be gossiping about your behavior the next day. You won't call attention away from the bride. You won't do anything embarrassing. You'll remember the whole thing (!) Your shoes will survive to dance at the next wedding.
Bring a camera-gives you something to do and the pics make a great gift down the road. Buy yourself something pretty to wear instead of spending it on drinking. The item of clothing will remind you during the wedding of the positives of not drinking.
You can do this!!