Hello, I'm not an expert, so please feel free to look this name up somewhere else to check, and I'm sure experts on this site can check, but saw one similar earlier in the year & looked it up in the Collins Complete British Wildlife (Paul Sterry) book... I think this is a Rhyssa persuasoria. Body length approx 35mm?? (not sure of scale in photo). Think close to gall wasp/sawfly family. Your photo is very well-caught!
Thanks for your reply. I have had a look at the wasp you suggest but I don't think it is that. I don't think it has the white markings along the side and I don't think it was that big. It has not got an ovipostor either and its back legs are black. I have the Collins Complete Guide to British Insects and I can't identify it from that.