How would I go about converting a BPCHAR field in a table into a BOOL and then set all values of 1 = TRUE, and all values of 0 = FALSE.

Thanks,

Jesse

    alter table t add tf bool;
    update t set tf=TRUE where bpfield='1';
    update t set tf=FALSE where bpfield='0';
    alter table t drop bpfield;

    You might wanna check to see if there's other values than 1/0 before you drop the field.

      Thanks again for your help! You've been great!

      I also found another way around this problem by exporting it out a different way.

      Thanks again!

      Jesse

        Yeah, there are always more than one way to skin a SQL cat. 🙂

        You could also do it something like:

        select
          case bpfield 
            when 1 then TRUE
            when 0 FALSE 
            else NULL 
          end,
        field2, field3, field4 
        into newtable 
        from oldtable 
        
          Write a Reply...