Can you detect a vitamin B 12 deficiency with a vitamin D test?

A vitamin D test... ...checks vitamin D, not B12. To check B12 you need a B12 test. Check with your doctor to see what he/she felt was necessary to order.
Different tests. B-12 is best detected by a B-12 level, methylmelonic acid and homocysteine. Of the several tests for Vitamin D, I like the total OH-Vitamin D-3 level, but cholecalciferol, and measures for D-2 also available.