alexkeel79
MIS
I am trying to write a nested Select Statement. I am running into trouble because I can't figure out how to use a value from the Main Select Statement in the nested Select. Here is the Select:
SELECT ISPTutorial.BusUnit, ISPTutorial.Division, ISPTutorial.Director, ISPTutorial.EmpGroup AS eg, (SELECT Count(ISPTutorial.Status) AS CountOfStatus
FROM ISPTutorial
WHERE ISPTutorial.Status = 'Completed' AND
ISPTutorial.EmpGroup = '***??????***'
GROUP BY ISPTutorial.EmpGroup)
FROM ISPTutorial
GROUP BY ISPTutorial.BusUnit, ISPTutorial.Division, ISPTutorial.Director, ISPTutorial.EmpGroup;
In my WHERE clause of the nested SELECT I need to replace the '***??????***' with the value of the ISPTutorial.EmpGroup from the main SELECT. Any suggestions? Thanks
SELECT ISPTutorial.BusUnit, ISPTutorial.Division, ISPTutorial.Director, ISPTutorial.EmpGroup AS eg, (SELECT Count(ISPTutorial.Status) AS CountOfStatus
FROM ISPTutorial
WHERE ISPTutorial.Status = 'Completed' AND
ISPTutorial.EmpGroup = '***??????***'
GROUP BY ISPTutorial.EmpGroup)
FROM ISPTutorial
GROUP BY ISPTutorial.BusUnit, ISPTutorial.Division, ISPTutorial.Director, ISPTutorial.EmpGroup;
In my WHERE clause of the nested SELECT I need to replace the '***??????***' with the value of the ISPTutorial.EmpGroup from the main SELECT. Any suggestions? Thanks