Microsoft beats forecasts with record revenue for Q2