Simple YES/NO Formatting question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JHNielson
    New Member
    • Feb 2007
    • 121

    Simple YES/NO Formatting question

    I think this is a simple question, but I couldn't find the answer looking through the previous posts.


    I have table [ETL] that has data in it in a YES/NO format.
    I append that table to another table [EXPORT] to then export the data. I need the YES/NO field to append to the [EXPORT] table as "Y' or "N".

    I formatted the field in the [EXPORT] table as text (3 characters) but I get -1 or 0.
    I can't figure out how to format the the data in the append query so I get Y/N.


    Thanks in advance
  • pks00
    Recognized Expert Contributor
    • Oct 2006
    • 280

    #2
    u could create a query which selects all the fields then export that
    eg

    select field1, field2, iif(myyesnofld= true,"Y","N") as yesnofld, field3, etc
    from mytable

    Comment

    • JHNielson
      New Member
      • Feb 2007
      • 121

      #3
      Originally posted by pks00
      u could create a query which selects all the fields then export that
      eg

      select field1, field2, iif(myyesnofld= true,"Y","N") as yesnofld, field3, etc
      from mytable

      That would work.

      First, could I put that command right in the append query. i.e. EXPR1: (if.....).

      Second, how would I code that in the standard ACCESS Query design window?

      Is there any other way, I would like to avoid the select query route if possible.
      I kept wondering if there was a way using the Format() function.

      Thanks,
      Harte

      Comment

      • pks00
        Recognized Expert Contributor
        • Oct 2006
        • 280

        #4
        How is your query currently?
        Is it a

        insert into ... select ...

        Comment

        • pks00
          Recognized Expert Contributor
          • Oct 2006
          • 280

          #5
          In the append query's design view
          in the field, change your field to have the iif in it

          eg
          say your field is called YNFld and table is called tblYN, then it would be


          MyYN: IIf([tblYN].[YNFld]=True,"Y","N")

          Comment

          • JHNielson
            New Member
            • Feb 2007
            • 121

            #6
            Originally posted by pks00
            In the append query's design view
            in the field, change your field to have the iif in it

            eg
            say your field is called YNFld and table is called tblYN, then it would be


            MyYN: IIf([tblYN].[YNFld]=True,"Y","N")

            GREAT!! Thanks so much.

            Comment

            • pks00
              Recognized Expert Contributor
              • Oct 2006
              • 280

              #7
              No worries :)

              Comment

              • kartikss
                New Member
                • Apr 2007
                • 25

                #8
                Hi

                For Yes/ No you try working this option ie

                First table for Yes / No
                In another table create Field where you want to create Yes / No option. - select the data type as Yes/No

                Below there is option of General in that there is option of Format. in that option is combo box select yes/no option from the drop down list.

                try this option, it might work.

                thanks & bye

                Kartik

                Comment

                Working...