Forum Discussion

SteveApa's avatar
SteveApa
Frequent Visitor
1 year ago
Solved

Create a string Column in Advanced Editor

Hi All... How do I create a new column (named Type) in advanced editor and set it to a string value?   let Source = Sql.Database("XXXXXX", "YYY", [Query=" select [Proj] as ""Proj#"", null as ""...
  • SteveApa's avatar
    1 year ago

    Sorry... But you are all incorrect.  I had a different typo.  It does work to assign a "string" to a new column in a select statemement:

    let
        Source = Sql.Database("xxxx", "yyy", [Query="
            select
                  'GDC' as ""Type""
            from
                [table1] 

            union
            select
                'bill' as [Type]
            from
                [table2] bill
          "])
    in
        Source