My upper stomach hurts at night and in the morning and is worse when I have anxiety or drink coffee. Sometimes the nasea lasts all day.?

See Dr. You may have ibs or irritable bowel syndrome but also possible gastritis or even peptic ulcer. Go and see a gastroenterologists to decide about need x endoscopy or at least your primary care physician. Avoid acid stuff/food, caffeine, chocolate, hot or spicy foodsminty, chewing gums, citrics, vit c etc. Try antacids, Zantac (ranitidine) pepcid, omeprazole. But you may need medicine for colic intestinal pains.
Gastritis. Your symptoms are suggestive of inflammation of the lining of your stomach. You need to avoid caffeine and smoking, as well as alcohol. Many products might help and are available over the counter. However, if you find very little or no relief, please see a doctor.
Acid. Sounds like you might have a problem with excess stomach acid. Try avoid acidy and irritating food and drinks (coffee, carbonated beverages, tomato sauce, salty foods, spicy foods, citrus, etc), and all Aspirin and anti-inflammatory medicines) for a week, use on otc acid blocker like Omeprazole daily. If this doesn't help, I suggest seeing your family doctor. You may be developing an ulcer.