Convert -1 or 0 to Y or N

G

Guest

How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do I do
this?

Thank you
 
A

Al Camp

Troy,
IIF([dbo_tblProductversion].[Attachments] = -1, "Y", "N")

This says... "If value is -1 then "Y", else it must be "N"
 
G

Guest

Just to be sure that your field is Yes/No field, open the table in design
view and check the field, mybe it a text field that Yes and No values were
inserted in to it.

Try
IIf([dbo_tblProductversion].[Attachments]="Yes","Y","N")

--
Good Luck
BS"D


Ofer Cohen said:
Hi troy, try

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")

--
Good Luck
BS"D


troy said:
How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do I do
this?

Thank you
 
G

Guest

I know this is odd but when I do this I get an error all the way down in my
fields. If I try and put it under my creteria it says data tye miss match.
Yes the table it is from is set at Y/N data type.

This is when I get my #error in all my fields
Attachments: IIf([dbo_tblProductversion].[Attachments]="Yes","Y","N")

If I just put it under my field in my creteria I get the data type mismatch.
What the heck is going on?

Ofer Cohen said:
Just to be sure that your field is Yes/No field, open the table in design
view and check the field, mybe it a text field that Yes and No values were
inserted in to it.

Try
IIf([dbo_tblProductversion].[Attachments]="Yes","Y","N")

--
Good Luck
BS"D


Ofer Cohen said:
Hi troy, try

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")

--
Good Luck
BS"D


troy said:
How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do I do
this?

Thank you
 
G

Guest

IT WORKED. I KNOW I TRIED THIS A HUNDERED TIMES BUT IT WORKED! THANK YOU VERY
MUCH!

Al Camp said:
Troy,
IIF([dbo_tblProductversion].[Attachments] = -1, "Y", "N")

This says... "If value is -1 then "Y", else it must be "N"
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

troy said:
How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do I do
this?

Thank you
 
G

Guest

Hi my name is Kim. I have the same situation. My query is based from the
table employee. The column in the query I want to change from -1 to "Y" is
I9submitt. How do I setup my IIf statement. I'm just not getting it.
Thanks in advance for your help.

Al Camp said:
Troy,
IIF([dbo_tblProductversion].[Attachments] = -1, "Y", "N")

This says... "If value is -1 then "Y", else it must be "N"
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

troy said:
How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do I do
this?

Thank you
 
G

Graham R Seach

Kim,

1. Open your query in design view.
2. Create a new column. In the Field cell, Enter the following:
YesOrNo: IIf(myfield=True, "Yes", "No")

Change "YesOrNo" to whatever you want to call this new column. Change
"myfield" to the name of the field containing -1 or 0.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Kim said:
Hi my name is Kim. I have the same situation. My query is based from
the
table employee. The column in the query I want to change from -1 to "Y"
is
I9submitt. How do I setup my IIf statement. I'm just not getting it.
Thanks in advance for your help.

Al Camp said:
Troy,
IIF([dbo_tblProductversion].[Attachments] = -1, "Y", "N")

This says... "If value is -1 then "Y", else it must be "N"
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

troy said:
How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT
datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do
I do
this?

Thank you
 
G

Guest

Thank you so much. This will help my coworkers not get confuse on the -1 and
0's. Thank you so much again.

Graham R Seach said:
Kim,

1. Open your query in design view.
2. Create a new column. In the Field cell, Enter the following:
YesOrNo: IIf(myfield=True, "Yes", "No")

Change "YesOrNo" to whatever you want to call this new column. Change
"myfield" to the name of the field containing -1 or 0.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Kim said:
Hi my name is Kim. I have the same situation. My query is based from
the
table employee. The column in the query I want to change from -1 to "Y"
is
I9submitt. How do I setup my IIf statement. I'm just not getting it.
Thanks in advance for your help.

Al Camp said:
Troy,
IIF([dbo_tblProductversion].[Attachments] = -1, "Y", "N")

This says... "If value is -1 then "Y", else it must be "N"
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

How do I convert the -1 or 0 from a Y/N datatype to a Y or N TEXT
datatype in
an Append query?

Here is my query (Select) will be going to an Append query

attachments: IIf([dbo_tblProductversion].[Attachments]=-1,"Y" Or 0,"N")

My results..

Attachments
N
N
-1
N
N
-1...etc

I am almost there but I still need to get those dang -1 to a "Y" how do
I do
this?

Thank you
 

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