By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

query expression in an expression

P: 2
I am building a query in Access 2003. Here is my problem.

I create an expression called SUN_ST
In a later expression I reference a calculation based on SUN_ST
ie, MON_ST=sum-SUN_ST

SUN_ST is not a value in a table it is a calculation/expression within the query.

How do I reference a query expression within an expression.

I tried MON_ST: [sum]-[SUM_ST] and when I run the query I get asked to enter the parameter value for SUN_ST

Any help would be appreciated.

Thanks
Mar 19 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,706
I am building a query in Access 2003. Here is my problem.

I create an expression called SUN_ST
In a later expression I reference a calculation based on SUN_ST
ie, MON_ST=sum-SUN_ST

SUN_ST is not a value in a table it is a calculation/expression within the query.

How do I reference a query expression within an expression.

I tried MON_ST: [sum]-[SUM_ST] and when I run the query I get asked to enter the parameter value for SUN_ST

Any help would be appreciated.

Thanks
You would have to reference the entire Expression that SUN_ST refers to.
Mar 19 '08 #2

P: 2
You would have to reference the entire Expression that SUN_ST refers to.
That is what I thought... if anyone has any other ideas that would be great.
Mar 20 '08 #3

NeoPa
Expert Mod 15k+
P: 31,769
There are rules about this. In some circumstances this is allowed, but in others it's not. It depends on the order of processing.

Post your current SQL (if it's not too vast) and we'll see what we can find.

Alternatively, a fairly foolproof method is to use a subquery to produce the calculated value (See Subqueries in SQL).
Mar 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.