I have had something called functional dyspepsia for over a year! it's a chronic stomach problem. I get nausea and stomach aches alot, sometimes I feel fine and others it flares up! Sounds like what you are saying. They ruled it out as functional dyspepsia as all the tests they do come out clear and if there is no sign of stomach damage and antacids don't help it is usually this.
I have to live with it forever! a bit like people with IBS say, it's here for good.
I would try antacids from your doctor, don't leave it!!
If antacids help it's usually something like an ulcer and ulcers clear up very quickly with antacids.
Doesn't sound like gastritis, as you would be in pain alot and feel pretty dreadful alot of the time.
You may have functional dyspepsia?? or it may just be because of your nerves.