A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error in query



 
 
Thread Tools Display Modes
  #1  
Old November 2nd, 2009, 08:44 PM posted to microsoft.public.access.queries
Rookie
external usenet poster
 
Posts: 65
Default #Error in query

I created an IIf statement in my query and it somewhat works. When I ran it,
the "False" showed up as "False". However, the "True" showed up as "#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie
  #2  
Old November 2nd, 2009, 08:56 PM posted to microsoft.public.access.queries
Dale Fye
external usenet poster
 
Posts: 2,651
Default #Error in query

Rookie,

Are the fields [Non-asp Findings] and [Normal Swallow] text fields or Yes/No?

If you want to store True/False type values in a table, I would recommend
the Yes/No datatype, which can be displayed as a checkbox. The advantage of
this method is that you don't actually have to test for "True" or "False",
you just create a logical expression.

Ab without ASP = [Non-Asp Findings] AND (NOT [Normal Swallow])

You might be running into a situation where one of the two fields contains a
NULL value, although the test for (NULL = "False") will evaluate to NULL, and
so will (NULL = "True"), so I'm not sure why this would cause an error.
----
HTH
Dale



"rookie" wrote:

I created an IIf statement in my query and it somewhat works. When I ran it,
the "False" showed up as "False". However, the "True" showed up as "#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie

  #3  
Old November 2nd, 2009, 11:15 PM posted to microsoft.public.access.queries
Rookie
external usenet poster
 
Posts: 65
Default #Error in query

Hi Dale Fye,
The "Normal Swallow" field is a Yes/No. The "Non-asp findings" was created
in another query as an expression.

I do not see the check boxes for the Yes/No field because I imported the
data from an excel file into Access 2003. Afterwards, I converted the "Normal
Swallow" field into a "Yes/No".

Therefore, I'm lost why it doesn't work... could it be that it's not a true
yes/no field?

"Dale Fye" wrote:

Rookie,

Are the fields [Non-asp Findings] and [Normal Swallow] text fields or Yes/No?

If you want to store True/False type values in a table, I would recommend
the Yes/No datatype, which can be displayed as a checkbox. The advantage of
this method is that you don't actually have to test for "True" or "False",
you just create a logical expression.

Ab without ASP = [Non-Asp Findings] AND (NOT [Normal Swallow])

You might be running into a situation where one of the two fields contains a
NULL value, although the test for (NULL = "False") will evaluate to NULL, and
so will (NULL = "True"), so I'm not sure why this would cause an error.
----
HTH
Dale



"rookie" wrote:

I created an IIf statement in my query and it somewhat works. When I ran it,
the "False" showed up as "False". However, the "True" showed up as "#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie

  #4  
Old November 3rd, 2009, 01:14 AM posted to microsoft.public.access.queries
Dale Fye
external usenet poster
 
Posts: 2,651
Default #Error in query

If it truely is a Yes/No field, then you cannot wrap the value in quotes,
you need to test against the boolean value. Try

Ab without Asp: IIf(([Non-Asp Findings]="True") And ([Normal Swallow]=
False),"True","False")

Dale

"rookie" wrote in message
...
Hi Dale Fye,
The "Normal Swallow" field is a Yes/No. The "Non-asp findings" was created
in another query as an expression.

I do not see the check boxes for the Yes/No field because I imported the
data from an excel file into Access 2003. Afterwards, I converted the
"Normal
Swallow" field into a "Yes/No".

Therefore, I'm lost why it doesn't work... could it be that it's not a
true
yes/no field?

"Dale Fye" wrote:

Rookie,

Are the fields [Non-asp Findings] and [Normal Swallow] text fields or
Yes/No?

If you want to store True/False type values in a table, I would recommend
the Yes/No datatype, which can be displayed as a checkbox. The advantage
of
this method is that you don't actually have to test for "True" or
"False",
you just create a logical expression.

Ab without ASP = [Non-Asp Findings] AND (NOT [Normal Swallow])

You might be running into a situation where one of the two fields
contains a
NULL value, although the test for (NULL = "False") will evaluate to NULL,
and
so will (NULL = "True"), so I'm not sure why this would cause an error.
----
HTH
Dale



"rookie" wrote:

I created an IIf statement in my query and it somewhat works. When I
ran it,
the "False" showed up as "False". However, the "True" showed up as
"#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie



  #5  
Old November 4th, 2009, 04:25 PM posted to microsoft.public.access.queries
Rookie
external usenet poster
 
Posts: 65
Default #Error in query

Hi Dale,
I tried your recommendation below and it didn't work. However, I did figure
it out by creating 2 separate IIf statement and it worked!

Thanks!
Rookie

"Dale Fye" wrote:

If it truely is a Yes/No field, then you cannot wrap the value in quotes,
you need to test against the boolean value. Try

Ab without Asp: IIf(([Non-Asp Findings]="True") And ([Normal Swallow]=
False),"True","False")

Dale

"rookie" wrote in message
...
Hi Dale Fye,
The "Normal Swallow" field is a Yes/No. The "Non-asp findings" was created
in another query as an expression.

I do not see the check boxes for the Yes/No field because I imported the
data from an excel file into Access 2003. Afterwards, I converted the
"Normal
Swallow" field into a "Yes/No".

Therefore, I'm lost why it doesn't work... could it be that it's not a
true
yes/no field?

"Dale Fye" wrote:

Rookie,

Are the fields [Non-asp Findings] and [Normal Swallow] text fields or
Yes/No?

If you want to store True/False type values in a table, I would recommend
the Yes/No datatype, which can be displayed as a checkbox. The advantage
of
this method is that you don't actually have to test for "True" or
"False",
you just create a logical expression.

Ab without ASP = [Non-Asp Findings] AND (NOT [Normal Swallow])

You might be running into a situation where one of the two fields
contains a
NULL value, although the test for (NULL = "False") will evaluate to NULL,
and
so will (NULL = "True"), so I'm not sure why this would cause an error.
----
HTH
Dale



"rookie" wrote:

I created an IIf statement in my query and it somewhat works. When I
ran it,
the "False" showed up as "False". However, the "True" showed up as
"#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie



.

  #6  
Old November 5th, 2009, 01:40 AM posted to microsoft.public.access.queries
Dale Fye
external usenet poster
 
Posts: 2,651
Default #Error in query

Rookie,

What did your final code look like:

Dale

"rookie" wrote in message
...
Hi Dale,
I tried your recommendation below and it didn't work. However, I did
figure
it out by creating 2 separate IIf statement and it worked!

Thanks!
Rookie

"Dale Fye" wrote:

If it truely is a Yes/No field, then you cannot wrap the value in quotes,
you need to test against the boolean value. Try

Ab without Asp: IIf(([Non-Asp Findings]="True") And ([Normal Swallow]=
False),"True","False")

Dale

"rookie" wrote in message
...
Hi Dale Fye,
The "Normal Swallow" field is a Yes/No. The "Non-asp findings" was
created
in another query as an expression.

I do not see the check boxes for the Yes/No field because I imported
the
data from an excel file into Access 2003. Afterwards, I converted the
"Normal
Swallow" field into a "Yes/No".

Therefore, I'm lost why it doesn't work... could it be that it's not a
true
yes/no field?

"Dale Fye" wrote:

Rookie,

Are the fields [Non-asp Findings] and [Normal Swallow] text fields or
Yes/No?

If you want to store True/False type values in a table, I would
recommend
the Yes/No datatype, which can be displayed as a checkbox. The
advantage
of
this method is that you don't actually have to test for "True" or
"False",
you just create a logical expression.

Ab without ASP = [Non-Asp Findings] AND (NOT [Normal Swallow])

You might be running into a situation where one of the two fields
contains a
NULL value, although the test for (NULL = "False") will evaluate to
NULL,
and
so will (NULL = "True"), so I'm not sure why this would cause an
error.
----
HTH
Dale



"rookie" wrote:

I created an IIf statement in my query and it somewhat works. When I
ran it,
the "False" showed up as "False". However, the "True" showed up as
"#Error".
Why is that?

Ab without Asp: IIf([Non-Asp Findings]="True" And [Normal
Swallow]="False","True","False")

Thanks!
Rookie



.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.