Data Type mismatch question

G

Guest

I am doing an update query with the following expression in my Update to
field. It worked fine yesterday now I am getting the datatype mismatch error.
Can someone look at this and tell me if it is ok or? Thank you

Field: Countersignatures
Table: Dev_dbo_tblProducts
Update to:
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]"
 
J

John Spencer

Is Dev_dbo_tblProducts.Countersignatures a text field or a yes/no (boolean)
field?

Your expression is generating a -1 everytime. Basically, the expression you
have evaluates to

Is "Y" or "N" equal to the phrase "[DEV_dbo_TblProduct].[Countersignatures]"
which is always going to be false.

As a guess you want
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")
 
G

Guest

Hello,

No the field is a Y/N data type and I need to convert to text type so when I
do my update query the target table will accept my conversion. The target
table is a Text data type with manual Y or N typed in. Yea I know but dont
ask me. I did not build this thing.

John Spencer said:
Is Dev_dbo_tblProducts.Countersignatures a text field or a yes/no (boolean)
field?

Your expression is generating a -1 everytime. Basically, the expression you
have evaluates to

Is "Y" or "N" equal to the phrase "[DEV_dbo_TblProduct].[Countersignatures]"
which is always going to be false.

As a guess you want
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")


troy said:
I am doing an update query with the following expression in my Update to
field. It worked fine yesterday now I am getting the datatype mismatch
error.
Can someone look at this and tell me if it is ok or? Thank you

Field: Countersignatures
Table: Dev_dbo_tblProducts
Update to:
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]"
 
G

Guest

Dont know why they were there. When I did my append query Access put them
there on its own. Thanks for noticing! Still get the misdata type though. Any
suggestions?

[MVP] S.Clark said:
Can CounterSignatures be Null?

Why are there doublequotes around the second
[DEV_dbo_TblProduct].[Countersignatures]?


--
Steve Clark, Access MVP
FMS, Inc
http://www.fmsinc.com/consulting
Professional Access Database Repair
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

troy said:
I am doing an update query with the following expression in my Update to
field. It worked fine yesterday now I am getting the datatype mismatch
error.
Can someone look at this and tell me if it is ok or? Thank you

Field: Countersignatures
Table: Dev_dbo_tblProducts
Update to:
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]"
 
G

Guest

Thank you I just looked at the expression you sent me. That is the expression
I am already using? Did you mean to send something different or?

John Spencer said:
Is Dev_dbo_tblProducts.Countersignatures a text field or a yes/no (boolean)
field?

Your expression is generating a -1 everytime. Basically, the expression you
have evaluates to

Is "Y" or "N" equal to the phrase "[DEV_dbo_TblProduct].[Countersignatures]"
which is always going to be false.

As a guess you want
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")


troy said:
I am doing an update query with the following expression in my Update to
field. It worked fine yesterday now I am getting the datatype mismatch
error.
Can someone look at this and tell me if it is ok or? Thank you

Field: Countersignatures
Table: Dev_dbo_tblProducts
Update to:
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]"
 
J

John Spencer

What I sent was not what you had in your post.

Your post had
Update to:
IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]"I suggestedIIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")IF your field is a Yes/No (boolean) field then you cannot put letters in it.It will only store true(-1) or false(0). I see you have a goodly number ofthreads going on this topic and have a had quite a bit of advice from peoplethat are expert on this subject. Somehow, there is some miscommunicationhappening.It might be time for you to hire someone (not me) to take a look at what youare doing."troy" <[email protected]> wrote in messagenews:[email protected]...> Thank you I just looked at the expression you sent me. That is theexpression> I am already using? Did you mean to send something different or?>> "John Spencer" wrote:>>> Is Dev_dbo_tblProducts.Countersignatures a text field or a yes/no(boolean)>> field?>>>> Your expression is generating a -1 everytime. Basically, the expressionyou>> have evaluates to>>>> Is "Y" or "N" equal to the phrase"[DEV_dbo_TblProduct].[Countersignatures]">> which is always going to be false.>>>> As a guess you want>> IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")>>>>>> "troy" <[email protected]> wrote in message>> news:[email protected]...>> >I am doing an update query with the following expression in my Update to>> > field. It worked fine yesterday now I am getting the datatype mismatch>> > error.>> > Can someone look at this and tell me if it is ok or? Thank you>> >>> > Field: Countersignatures>> > Table: Dev_dbo_tblProducts>> > Update to:>> >IIf([dbo_tblProductversion].[Countersignatures]=-1,"Y","N")="[DEV_dbo_TblProduct].[Countersignatures]">>>>>>
 

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

Similar Threads


Top