Following the outbreak of the First World War Sanday learned to fly, being granted
Royal Aero Club Aviators' Certificate No. 1295 on 2 June 1915 after soloing a
Maurice Farman biplane at the Military School at
Brooklands. He was commissioned as a second lieutenant on probation in the
Royal Flying Corps the same day at the relatively advanced age of 32, and following further training was confirmed in his rank, and then appointed a
flying officer on 7 August. He was then posted to
No. 2 Squadron to fly the
B.E.2c two-seater. He gained his first aerial victory on 11 October when, in conjunction with two other aircraft, he and his observer Second Lieutenant Ellison, forced down a German
Albatros two-seater at
Noyelles-lès-Vermelles and captured the crew. and following an
artillery spotting mission on 1 January 1916 was awarded the
Military Cross. His citation read: :Second Lieutenant (Temporary Captain) William Douglas Stock Sanday, Royal Flying Corps, Special Reserve. ::"For conspicuous gallantry and skill near
Hulluch on 1 January 1916. He went out in a very high wind to observe the fire of a battery, and, owing to the clouds, was forced to fly at a height of between . Although continually subjected to very heavy rifle fire from the German trenches, he enabled our battery to obtain several direct hits." He was promoted to lieutenant on 7 January 1916, backdated to 1 December 1915, but was badly injured in a crash two days later on 9 January, Sanday was promoted to captain on 1 August, and on the evening on 6 August, he led a patrol which encountered a formation of ten German bomber aircraft near
Bapaume. The British attacked, and fought the Germans all the way back to their own aerodrome, compelling them to land with their bombs still loaded. The next day, 21 October, Sanday was appointed a squadron commander with the acting rank of major, and following the death in action of Major D. H. Harvey-Kelly,
Officer Commanding No. 19 Squadron, on 29 April 1917, Sanday was appointed to command. Flying a
Spad VII single-seat fighter, he gained his fifth and final victory on 13 July, destroying a German reconnaissance aircraft over
Lille. and on 21 March was appointed a
wing commander with the acting rank of lieutenant colonel. He was again appointed an acting-lieutenant colonel when appointed an
air attaché and posted to the
British Embassy at Madrid on 2 May 1919. On 1 August Sanday was granted a permanent commission in the RAF with the rank of major, but this was cancelled on 23 September, and he relinquished his commission owing to "ill-health contracted on active service" on 30 December 1919, but was granted the rank of lieutenant colonel. ==Post-war career==