IIF() please help

R

rock

Dear All,

I am working on a MS Access Select query where I am using an IIF()
function


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],'LOW')



Output: If condition is TRUE then it works, but when condition is
false it will return nothing.


I have also tried


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],"LOW")



Regsrds,
Shital
 
B

BruceM

Try testing it with text:
IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],"True","False")
Does it ever show False?

Dear All,

I am working on a MS Access Select query where I am using an IIF()
function


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],'LOW')



Output: If condition is TRUE then it works, but when condition is
false it will return nothing.


I have also tried


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],"LOW")



Regsrds,
Shital
 
R

rock

hi Bruce,

I have tried this , but it won't return anything, not even if
condition is true.....

regards,
shital
 
B

BruceM

Do you mean it never returns anything, no matter what? What are these two
POSTALCODE fields? Are they in fields from tables that are included in your
query?

hi Bruce,

I have tried this , but it won't return anything, not even if
condition is true.....

regards,
shital
 
R

rock

Hi Bruce,

POSTALCODE are the column/fields of the table "dbo_loc" and
"TRHazardZones"

If I run the original query, Only "true expression" get populated and
not the "false expression" , whereas if I run your query nothing will
comeout.

Regards,
Shital
Do you mean it never returns anything, no matter what? What are these two
POSTALCODE fields? Are they in fields from tables that are included in your
query?

hi Bruce,

I have tried this , but it won't return anything, not even if
condition is true.....

regards,
shital

Try testing it with text:
IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],"True","False")
Does it ever show False?

Dear All,

I am working on a MS Access Select query where I am using an IIF()
function


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],'LOW')



Output: If condition is TRUE then it works, but when condition is
false it will return nothing.


I have also tried


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],"LOW")



Regsrds,
Shital
 
B

BruceM

Again: Are the POSTALCODE fields in tables that are included in your query?
If so, is there a relationship between the tables?

In query design view, add this to an empty column:
NewField:
IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],"True","False")
Do you still get nothing? I don't see how the expression could evaluate to
neither True nor False.

If problems persist, keep breaking it down. Try these as calculated query
fields (i.e. empty columns in the design grid):
TestLoc: [dbo_loc]![POSTALCODE]
TestHazZones: [TRHazardZones]![POSTALCODE]
In the query design grid, move them so that they are next to the two
POSTALCODE fields.
When you switch to datasheet view, do you see anything in those fields?

Hi Bruce,

POSTALCODE are the column/fields of the table "dbo_loc" and
"TRHazardZones"

If I run the original query, Only "true expression" get populated and
not the "false expression" , whereas if I run your query nothing will
comeout.

Regards,
Shital
Do you mean it never returns anything, no matter what? What are these two
POSTALCODE fields? Are they in fields from tables that are included in
your
query?

hi Bruce,

I have tried this , but it won't return anything, not even if
condition is true.....

regards,
shital

Try testing it with text:
IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],"True","False")
Does it ever show False?

Dear All,

I am working on a MS Access Select query where I am using an IIF()
function


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],'LOW')



Output: If condition is TRUE then it works, but when condition is
false it will return nothing.


I have also tried


IIf([dbo_loc]![POSTALCODE]=[TRHazardZones]![POSTALCODE],[TRHazardZones]![TR­ZONES],"LOW")



Regsrds,
Shital
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top