troy wrote:
> I have a query that has a text field with Y and N 0 and need to append that
> data to an SQL side that is set up as data type Y/N.
> It looks like this..
>
> My Query..How do I append the text yes and no to the datatype Y/N in a
> record (field)?
>
> Here is the way it is now but does not work..
> Field (is yes/no data type) (SQL side)
> EAandOFlag: IIf(dbo_TblProductVersion.EAndOFlag=-1,"Y" Or 0,"N")
> append to: EAndOFlag
>
> The SQL side is Y/N field. The database side is Data Type text field
>
> PLEASE HELP ME TO SET UP THE QUERY SO I CAN APPEND THE TEXT DATA INTO THE
> DATATYPE y/n.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
EAandOFlag: IIf(dbo_tblProductVersion.EAandOFlag=-1,"Y","N")
The IIf() syntax is:
IIf(<evaluation expression>, <true expression>, <false expression>)
Which can be show in VBA pseudo-code like this:
If <evaluation expression> = True Then
<true expression>
Else
<false expression>
End If
Since the only values of the field are Y, N, and 0 then the True would
translate to Y, and the N and 0 would translate to N (since 0 = False).
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBRE1pR4echKqOuFEgEQJu2QCbBEVFbD1yDiqHm22wGTEEymsYJMgAnior
VCOnzbDeAgFx73NA6qM5LiP+
=vewo
-----END PGP SIGNATURE-----
|