Need help moving a shower drain

Let me start off by saying that this is a great forum. I keep Googling questions about plumbing and time after time I am linked to this forum.

I am a DIYer with little to no knowledge of the plumbing code. I am a firm believer in doing things right the first time. I am in the process of finishing my basement and I need to change the bathroom rough-in the builder left in the basement floor. I am attaching a photo of what I found when I broke up the foundation. I need to move the 2" shower drain about 6-8" to the open side of the concrete hole. Am I allowed to use a 90 degree elbo to move to the side before I attached a P trap? I want to cut out the P trap that is currently on the pipe, attach a 90 degree elbo with about 4-6" of pipe, then attached another P trap that would connect to my shower base drain. Am I allowed to do this or is there a better way?
Dave

As suggested, use a sweep rather than a standard elbow. The elbow is a very sharp bend and increases the chance for a clog and will make snaking the drain quite difficult if/when it has to be done. A sweep make the curve much more gentle. Thing of taking a corner in the city as the elbow and a wide sweeping curve on the freeway. Both make a 90 degree, but you can do the sweep at 70 mph.

If you only need to move the location of the riser 6"-8", then the "P" trap and any elbow will move it much further than that just because of their physical dimensions. A 45 degree elbow in conjuction with rotating the joint of the trap might put it in the correct place.

Thanks for all the advice....I'll definitely use a sweep instead of a hard 90. Adjusting the P trap won't help because it is already pointing the direction I want to go. Just to confirm, there are no code issues with using a sweep to move horizontally a few inches to the right?

and just to confirm what you need confirmed, yes yes you can do it and it is OK to do it as described.

one more little thing, which you can ignore after you read this: ideally you place the new P trap 1/8th" higher than before, so the new little piece of a couple inches of pipe will have an almost imperceptible slope to it. Now you can disregard what I have just said, since such a short piece makes it all insignificant, irrelevant, immaterial and not worth sweating over.

On the other hand, please do note what hj recommended. Furthermore, there is a way to implement it... And it is a good idea worth implementing, and it is easy to do.

Water coming out of a P trap has no "memory" so you can orient the P trap slightly "away" from the target (top left hand corner of the picture). Send the Ptrap towards the bottom left hand corner of the picture. Then you get a clean view of your target at a 45 degree angle... and that is where you connect the 45. This is in fact and in practice better than any 90 degree angle. This is not insignificant. It is worth doing.

But not serious.

David
edit: but you can also use a 45 without turning the P trap too. In any case, you may have to chip away some more of that concrete floor.