Y/N in a text field to a Y/N Datatype field HOW?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Are you going to keep both fields in your table? That would create
redundant data and would not be "normalized" design.

I'd create the new Boolean field in your table, then build an UPDATE query
to take the Y or N from the other field and update the new Boolean field.
I'd then delete the previous text field. I'd make a backup of the table (or
the whole database) before running any kind of update query.

Before you go through all that trouble, you might (make a backup first)
simply try to change the field in the table. If all the entries are Y and
N, it might actually let you change the type to Boolean. I've never tried
it though.
 
Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False
 
I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

Ofer Cohen said:
Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


troy said:
How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Yes I know I just took on this database from another co-worker and a hugh
mess. Right now I just need to have every record that has either a Y or N in
my field to move in my updatde or append query. Do you know what the
expression is?
 
Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


troy said:
I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

Ofer Cohen said:
Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


troy said:
How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

Ofer Cohen said:
Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


troy said:
I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

Ofer Cohen said:
Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


troy said:
Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

Ofer Cohen said:
Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


troy said:
I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
I am getting a data type missmatch in criteria expression. I have approx 6
tables and 3 of them have the same dang data in them. I need to view 13
different fields so it is a complicated query but If I can get on of those
expressions to work I can take it from there. Any idea why I am getting that
error? thanks again

troy said:
Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

Ofer Cohen said:
Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


troy said:
I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
OK I will. You know I just looked at the table where the data is comming from
and that table has the correct data type as yes/no. So what I need to do is
to send that data to a table that has the fields set up as a text data type.
It looks like they are manually typing in either Y or N into that table. How
do I convert a dtattype of y/n to text. Is it the same way or? Thanks for
being so patient!

Ofer Cohen said:
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


troy said:
Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

Ofer Cohen said:
Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


:

I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Yes, in the same way

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")
--
Good Luck
BS"D


troy said:
OK I will. You know I just looked at the table where the data is comming from
and that table has the correct data type as yes/no. So what I need to do is
to send that data to a table that has the fields set up as a text data type.
It looks like they are manually typing in either Y or N into that table. How
do I convert a dtattype of y/n to text. Is it the same way or? Thanks for
being so patient!

Ofer Cohen said:
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


troy said:
Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

:

Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


:

I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Great it worked Thank you so much. So I dont need to make a seprate query
just bring down my other fields and add that expression for all the fields
that need to be converted correct? Thanks again

Ofer Cohen said:
Yes, in the same way

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")
--
Good Luck
BS"D


troy said:
OK I will. You know I just looked at the table where the data is comming from
and that table has the correct data type as yes/no. So what I need to do is
to send that data to a table that has the fields set up as a text data type.
It looks like they are manually typing in either Y or N into that table. How
do I convert a dtattype of y/n to text. Is it the same way or? Thanks for
being so patient!

Ofer Cohen said:
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


:

Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

:

Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


:

I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Hello again,

I just took a second look at it today and it does not work. The below either
gives me an error msg or adds a seprate field called new attachment and shows
me the same data in the attachment field. What I am trying to do is convert
the -1 or 0 into a Y or N field so I can append the data to another table
that has the same filed but set up as a text filed with a Y or N in the
filed. Does that make sense? Thank you for your efforts

Ofer Cohen said:
Yes, in the same way

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")
--
Good Luck
BS"D


troy said:
OK I will. You know I just looked at the table where the data is comming from
and that table has the correct data type as yes/no. So what I need to do is
to send that data to a table that has the fields set up as a text data type.
It looks like they are manually typing in either Y or N into that table. How
do I convert a dtattype of y/n to text. Is it the same way or? Thanks for
being so patient!

Ofer Cohen said:
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


:

Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

:

Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


:

I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 
Cohen,

I put this in the SQL statement and it almost works but it only returns the
"n" and shows the -1. I am almost there but how can I det it to show the "y"
also?

Thanks again

Ofer Cohen said:
Yes, in the same way

IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")
--
Good Luck
BS"D


troy said:
OK I will. You know I just looked at the table where the data is comming from
and that table has the correct data type as yes/no. So what I need to do is
to send that data to a table that has the fields set up as a text data type.
It looks like they are manually typing in either Y or N into that table. How
do I convert a dtattype of y/n to text. Is it the same way or? Thanks for
being so patient!

Ofer Cohen said:
It should, before you run any update query you can try it with a simle Select
Query

Select [dbo_tblProductversion].[Attachments] ,
IIf([dbo_tblProductversion].[Attachments]="Y",True,False) As NewAttachments
From dbo_tblProductversion

Check the new field values if it answer you question, if it does the change
it to update query

In any case back up your data first
--
Good Luck
BS"D


:

Does this expression look like it would work? I have about 5 fields the same
way. Driving me nuts
IIf([dbo_tblProductversion].[Attachments]="Y",True,False)

Thank you so much for your help!

:

Yes it will replace the Y and N text values to True and False, so you can
update the Yes/No field
--
Good Luck
BS"D


:

I need to find the expression that will show me the results of every record
that has a Y or N in the "Attachment" field that holds the data (the Y or N).
What you gave me will do the trick?

:

Try

IIf([FieldName] = "Y", True , False)

In that case every field that doesnt have "Y" in it will be False

--
Good Luck
BS"D


:

How do you pull data (in a query) from a datatype "text" that is manually
typed in as either a Y or N so I can append or update to another field that
is set up as a Datatype Y/N field? I want to do an update query but dont know
the expression to do this. Can it be done? Can someone help? Thanks in advance
 

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

Back
Top