Corticostriatal NMDARs mediate certain learning and executive functions. Here Brigman et al. demonstrate that the NMDAR GluN2B subunit in dorsolateral striatum of mice is important for learning a behavioral choice and that its action is dissociable from that of GluN2B in orbitofrontal cortex in flexibly shifting choice behavior.