Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Subqueries cannot be used in the expression

Status
Not open for further replies.

webcats

Programmer
Apr 24, 2002
60
0
0
US
Hi all,

I've tried searching for this problem (this site and Google), but I haven't found an answer yet.

I have a query that was working fine until today.

In the Field area of the QBE grid I have:

Total Current: Sum([earned_current]+[unearned_current])

The query is grouped and I have the Total line set to Expression.


The error I'm getting is: Subqueries cannot be used in the expression ([earned_current]+[unearned_current]).

Does anyone know why I'm suddenly getting this error? It's driving me to drink!

Thanks.

 
Can you please post the SQL code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PH,

Here is the SQL:

Code:
SELECT Sum([earned_current]+[unearned_current]) AS [Total Current]
FROM tbl308_PreviousMonth_FS INNER JOIN tlkpTranslate_Descr_Fresno ON tbl308_PreviousMonth_FS.Serv_Code = tlkpTranslate_Descr_Fresno.Service_Code;

Thanks!
 
Nothing wrong I can see.
Have you tried to compact/repair the DB ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Exactly!

That's why it's driving me to drink...

I've compacted/repaired, I've created a blank database and imported all the objects into it, I've checked all my References, I've re-compiled all the code (I figured it couldn't hurt), I rebooted my computer (twice) - still the same error.

What's even stranger is that I have another database that uses the exact same query except for another area and it's working fine!

Maybe I'll import the other query that's working and just change the table names...

Thanks anyway!
 
Are tbl308_PreviousMonth_FS and tlkpTranslate_Descr_Fresno both real tables ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes, they're real tables.

I got it to work. I imported the other query (from the other area that does work), and changed the table names to match the Fresno area and now it works.

Very strange. Can a query be corrupted?

Thanks!
 
Can a query be corrupted?
Sure, absolutely ANYTHING may be corrupted in Access ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top