Won't start

2010 Mercedes e200cdi sport (w212)
Ignition comes on but car won't turn over. After a few attempts or sometimes after nearly an hour of trying it starts perfectly. Mite do it the next several times I try to start it or mite not do it again for a week or two. Runs perfect when started. Any help appreciated. Thanks