Run SQL queries in MS Excel

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 7

  • @enricomendiola9952
    @enricomendiola9952 3 місяці тому

    Great video. Can you please also show how to use join in the native query?

  • @googleplususer3009
    @googleplususer3009 5 місяців тому

    Nice video - except that there is no "Close and load to..." option (greyed out), and before that there no "View native query" in the Navigation pull down ....
    Is there now now way of writing queries in SQL in MS Excel ?????
    I can do complex things in SQL ... with the new Power Query I can't even figure out how to get a HAVING clause, let alone make a query which lists all records from one excel table with a duplicate key value (in column A). I can do that in SQL though ..... if SQL was available

  • @gagansingh3481
    @gagansingh3481 10 місяців тому

    Please share the vba code

    • @RealOfficeWiz
      @RealOfficeWiz  10 місяців тому

      Hi Gagan , Use the below code and remember to change your query table name in it .
      Private Sub Worksheet_Change(ByVal Target As Range)

      Dim tbl As ListObject
      Set tbl = Me.ListObjects("Your Query Tabel Name Here")
      If Not Intersect(Target, tbl.Range) Is Nothing Then
      ActiveWorkbook.RefreshAll
      End If
      End Sub

    • @gagansingh3481
      @gagansingh3481 10 місяців тому

      ​@@RealOfficeWiz- thank you so much

    • @gagansingh3481
      @gagansingh3481 10 місяців тому

      @@RealOfficeWiz - which query table i have to mention or I have apply vba code to the entire worksheet or i have to select the query box table ... my table from sql server is tblemployee

    • @RealOfficeWiz
      @RealOfficeWiz  10 місяців тому

      You need to apply vba only on the sheet where your second table is,in which you write sql queries. Same table name you need to mention in the vba code. :)