470,638 Members | 1,577 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,638 developers. It's quick & easy.

query expression in an expression

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
3 3290
ADezii
8,804 Expert 8TB
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
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
32,301 Expert Mod 16PB
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.

Similar topics

7 posts views Thread by John Øllgård Jensen | last post: by
1 post views Thread by Michel Walsh | last post: by
1 post views Thread by Korara | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.