ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculated fields in MSQUERY (https://www.excelbanter.com/excel-discussion-misc-queries/174969-calculated-fields-msquery.html)

PeterW

Calculated fields in MSQUERY
 
I am new to query and struggling with a conditional field value. I want to
include the actual amount for a cost type if there is a match or 0 if no
match.
I am trying
IIF(Fieldname = "APP",FIELDNAME2,0)
This works ok in access but I get a 'Column not found message' in query.
Is it not possible to do this or am I missing something?
Grateful for any suggestions

FSt1

Calculated fields in MSQUERY
 
hi
is the data you are drawing into excel from the Access db you mentioned.
if so, you might find it easier to write the query in access and use MSQ to
draw the access query result in to excel. MSQ is good but has some limitation
that access doesn't have. If your have critera, the critera(parameters) MUST
be on the excel side otherwise you will get an error - too few paarameters.
expected x.

regards
FSt1

"PeterW" wrote:

I am new to query and struggling with a conditional field value. I want to
include the actual amount for a cost type if there is a match or 0 if no
match.
I am trying
IIF(Fieldname = "APP",FIELDNAME2,0)
This works ok in access but I get a 'Column not found message' in query.
Is it not possible to do this or am I missing something?
Grateful for any suggestions


PeterW

Calculated fields in MSQUERY
 
Thanks - Unfortunateley the data is in a sage database not access. Do you
know if msquery allows this type of calculated field?

"FSt1" wrote:

hi
is the data you are drawing into excel from the Access db you mentioned.
if so, you might find it easier to write the query in access and use MSQ to
draw the access query result in to excel. MSQ is good but has some limitation
that access doesn't have. If your have critera, the critera(parameters) MUST
be on the excel side otherwise you will get an error - too few paarameters.
expected x.

regards
FSt1

"PeterW" wrote:

I am new to query and struggling with a conditional field value. I want to
include the actual amount for a cost type if there is a match or 0 if no
match.
I am trying
IIF(Fieldname = "APP",FIELDNAME2,0)
This works ok in access but I get a 'Column not found message' in query.
Is it not possible to do this or am I missing something?
Grateful for any suggestions



All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com