I have 3 tables, [main], [building], and [department]. Main has FKs for Building and Department. I want to know what departments i have in certain buildings (maybe more than one)

I first get the Building FK here: (I can choose by building name and return the building key)

CHOOSE vbuildcode FROM #VALUES FOR building_name, building_id  +
FROM building +
ORDER BY building_name LINES 25

Then I get the Department FK based on the first CHOOSE:

CHOOSE vdeptcode FROM #VALUES FOR DISTINCT (department_code & [[ name of dept from dept table]]), department_code +
FROM main +
WHERE building_code=.vbuildcode ORDER BY department_code


What I want to to be able to also have the name of the department show up in the second choose, but I can't figure out how to do that.



Reply via email to