Simple SQL problem

stevenblanc

Registered User.
Local time
Today, 06:00
Joined
Jun 27, 2011
Messages
103
hi there folks,

So after not touching Access for a year and a half I feel like I've forgotten everything. So please forgive me for this:

I have the following SQL string:

SELECT courseID, SUM(num_labreport * enrollment * (SELECT estimatehrs FROM tbl_guidelines WHERE itemindex = 1)) as labhours, SUM(num_exammc * enrollment * (SELECT estimatehrs FROM tbl_guidelines WHERE itemindex = 2)) as exammchours, SUM(num_examone * enrollment * (SELECT estimatehrs FROM tbl_guidelines WHERE itemindex = 3)) as examonehours, SUM(num_examtwo * enrollment * (SELECT estimatehrs FROM tbl_guidelines WHERE itemindex = 4)) as examtwohours, (labhours + exammchours + examonehours + examtwohours) as TotalHours FROM tbl_budgetsheet WHERE tbl_semesters.Semester = '2012 Winter' GROUP BY courseID ;

It is constructed part by part in VBA through user selections. For some reason Access keeps prompting me for the value for tbl_semesters.Semester.

I have also tried using quotations as opposed to single quotations. The value 2012 Winter is valid.

EDIT: I should add that this is executed as a listbox rowsource.

Any thoughts?
 
That table isn't in the FROM clause.
 
Paul,

Thanks. I don't know how I could've done such a thing! I used the reference table. EGADS!
 
LOL! We've all done it.
 

Users who are viewing this thread

Back
Top Bottom