Skip to content Skip to sidebar Skip to footer

Use Column Alias From Sql Query As Column Header In Excel

I have the following VBA to get datas from the database using the SQL statement in this VBA: Sub ConnectDB5() Dim conn As New ADODB.Connection Dim rs As New ADODB.Recordset

Solution 1:

Try this to get one ROW more with the fieldname:

strSQL = " SELECT 'campaign'  UNION ALL SELECT " & _
            " cID AS Campaign " & _
            " FROM PDW_DIM_Offers_Logistics_history " & _
            " WHERE DATE(insert_timestamp) = ""2020-02-24"" "

Post a Comment for "Use Column Alias From Sql Query As Column Header In Excel"