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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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 | |
|
|