Tech stocks took the Nasdaq Composite and S&P 500 to record highs Wednesday, with Amazon, Alphabet, and Apple driving the gains.

The Nasdaq rose 1 percent, closing at 8,109.69 and the S&P 500 climbed 0.6 percent to close above 2,900 for the first time at 2,914.04. The Dow Jones Industrial average was up 60.55 to 26,124.57 with Apple hitting its all time high at 1.5 percent.

Amazon shares climbed 3.4 percent to a record $1,998.10, putting the online retail giant $26 billion away from matching Apple as trillion dollar company. Following a new price target from Morgan Stanley, which predicts a $1.2 trillion valuation for Amazon.

Google parent Alphabet also got a boost from Morgan Stanley raising its price target, and its shares rose 1.5 percent to close at $1,264.65.