Referencing column of query from another column in the query

  • Thread starter Thread starter Yair Sageev
  • Start date Start date
Y

Yair Sageev

Sorry for the barrage of posts. I have the following situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal referencing possible?

Thanks again.
 
Yair,

I am having the same problem. However, I don't understand
your solution "group by." I thought this was only
available in the Update Query. I am not running an action
query. Any ideas?

Ken
-----Original Message-----
Ignore post, I needed to "group by" expression in the self-referencing
column.



Yair Sageev said:
Sorry for the barrage of posts. I have the following situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal referencing possible?

Thanks again.


.
 
You're right, my post was unclear. There are two problems.

1. Make sure that if you query references queries that reference forms,
those forms are running. (duh ;0)

2. When that happens, you might get numerous identical results. For every
field that causes the identical results, select "group by expression" for
that field.

Hope this helps.


Ken said:
Yair,

I am having the same problem. However, I don't understand
your solution "group by." I thought this was only
available in the Update Query. I am not running an action
query. Any ideas?

Ken
-----Original Message-----
Ignore post, I needed to "group by" expression in the self-referencing
column.



Yair Sageev said:
Sorry for the barrage of posts. I have the following situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal referencing possible?

Thanks again.


.
 
Yair,

Thanks for the explanation. My query is just a query that
references a single table. I created a field
[PropTypeConv]in the query that converts a property type
abbreviation from one field [PropType]into the full name
using and IIF statement in the expression. The conversion
field [PropTypeConv]works. I want the results of this
field ([PropTypeConv])to be used as the query criteria in
a field named [Survey]. So, I put "=[PropTypeConv]" as
the criteria and like you, it treated it like it was a
parameter query. I still don't know how to get one field
to query off the results of another. Maybe I will try to
put the reference field before (in datasheet design view)
the other field and maybe it needs to be processed before
the other field.

Ken
-----Original Message-----
You're right, my post was unclear. There are two problems.

1. Make sure that if you query references queries that reference forms,
those forms are running. (duh ;0)

2. When that happens, you might get numerous identical results. For every
field that causes the identical results, select "group by expression" for
that field.

Hope this helps.


Ken said:
Yair,

I am having the same problem. However, I don't understand
your solution "group by." I thought this was only
available in the Update Query. I am not running an action
query. Any ideas?

Ken
-----Original Message-----
Ignore post, I needed to "group by" expression in the self-referencing
column.



Sorry for the barrage of posts. I have the following situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal referencing possible?

Thanks again.




.


.
 
Ken,

I'm in a bit of a rush right now, but my advice here is to try the simplest
case first, without the IIF.

Try making a test query with two columns, the second column a calculation
based on the first, as was mentioned in the original post. When you get that
to work, add complexity to it until it breaks. Hopefully that will shed
some light on the problem. Sorry for the overly general response.

Ken said:
Yair,

Thanks for the explanation. My query is just a query that
references a single table. I created a field
[PropTypeConv]in the query that converts a property type
abbreviation from one field [PropType]into the full name
using and IIF statement in the expression. The conversion
field [PropTypeConv]works. I want the results of this
field ([PropTypeConv])to be used as the query criteria in
a field named [Survey]. So, I put "=[PropTypeConv]" as
the criteria and like you, it treated it like it was a
parameter query. I still don't know how to get one field
to query off the results of another. Maybe I will try to
put the reference field before (in datasheet design view)
the other field and maybe it needs to be processed before
the other field.

Ken
-----Original Message-----
You're right, my post was unclear. There are two problems.

1. Make sure that if you query references queries that reference forms,
those forms are running. (duh ;0)

2. When that happens, you might get numerous identical results. For every
field that causes the identical results, select "group by expression" for
that field.

Hope this helps.


Ken said:
Yair,

I am having the same problem. However, I don't understand
your solution "group by." I thought this was only
available in the Update Query. I am not running an action
query. Any ideas?

Ken
-----Original Message-----
Ignore post, I needed to "group by" expression in the
self-referencing
column.



Sorry for the barrage of posts. I have the following
situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal
referencing possible?

Thanks again.




.


.
 
Ken,

Just noticed one other thing: Access doesn't like it if a calculated column
in the query references a column in a table and a another calculated column
in the query.

E.g:

Col1:

TEST: projBudget

Col2

TEST2: TEST * someFieldFromATable.


I worked around this by

Col2:

TEST2: someFieldFromATable

Col3:

TEST3: TEST*TEST2



Hope this helps.




Ken said:
Yair,

Thanks for the explanation. My query is just a query that
references a single table. I created a field
[PropTypeConv]in the query that converts a property type
abbreviation from one field [PropType]into the full name
using and IIF statement in the expression. The conversion
field [PropTypeConv]works. I want the results of this
field ([PropTypeConv])to be used as the query criteria in
a field named [Survey]. So, I put "=[PropTypeConv]" as
the criteria and like you, it treated it like it was a
parameter query. I still don't know how to get one field
to query off the results of another. Maybe I will try to
put the reference field before (in datasheet design view)
the other field and maybe it needs to be processed before
the other field.

Ken
-----Original Message-----
You're right, my post was unclear. There are two problems.

1. Make sure that if you query references queries that reference forms,
those forms are running. (duh ;0)

2. When that happens, you might get numerous identical results. For every
field that causes the identical results, select "group by expression" for
that field.

Hope this helps.


Ken said:
Yair,

I am having the same problem. However, I don't understand
your solution "group by." I thought this was only
available in the Update Query. I am not running an action
query. Any ideas?

Ken
-----Original Message-----
Ignore post, I needed to "group by" expression in the
self-referencing
column.



Sorry for the barrage of posts. I have the following
situation:

Table Projects has a column, projBudget, a number.

Column1 of the query is Foo: [projBudget]".

Column2 is Bar:[Foo] + 45678

I keep getting prompted for "Foo". Is this internal
referencing possible?

Thanks again.




.


.
 
Back
Top