Access 2007 Query Hell *solved*

Saint Nick

Lifer
Jan 21, 2005
17,722
6
81
I am trying to run the below SQL, but when I do so, it is prompting me to enter values for both [Total Hours] and Goal. They are declared in the SELECT statement...so why is Access making me enter values??? I just want to display the results where one column is equal to or greater than another one.
 

Saint Nick

Lifer
Jan 21, 2005
17,722
6
81
I gave it a whirl, but it was still prompting me for "Goal" :confused:

Access is such a POS...I should have done this in MySQL... Thanks for the shot though, keep trying...anything is better than what I have come up with so far and I've spent far too many hours trying to get this working.
 

Saint Nick

Lifer
Jan 21, 2005
17,722
6
81
I tried Vinyl's latest post, and the code ran without prompting me to enter anything, but is now posting the results of the query as if the WHERE wasn't in there (query returns all values instead of where they are equal or greater than). Also, KLin, I renamed the alias to "Goal1" instead of "Goal" in an effort to test your post, but didn't get any different results.
 

KLin

Lifer
Feb 29, 2000
30,454
763
126
Remove the double quotes from the "Total Hours" alias and use square brackets. Add in a line after the group by line that says "having [Total Hours] >= Goal.[Goal-Target]" w/o double quotes.
 

Saint Nick

Lifer
Jan 21, 2005
17,722
6
81
Thanks for both of your help, I got it working. What I did was used that HAVING statement KLin provided and replaced [Total Hours] (because that wasn't working?) with Sum(Hours*24).

Thanks again :)

Jared