sql

  1. M

    VBA to update SQL table

    Hi All I am new to Excel /VBA and have been asked to create a excel workbook that takes data from a SQL table and the user then updates the spreadsheet and then clicks a button to update the table. I seem to be unable to get the update to work and to me its a very simple task! (Or Should be)...
  2. S

    Automating daily tasks using Excel/Power Query and SQL

    So I am looking at COVID stats all day and I have to prepare them for my manager. This is a multistage process and it's fairly repetive. As a result i want to automate it so i can spend my days doing more productive **** or cat videos. Either i am not bothered. It's a multi stage process and...
  3. A

    VBA Cascading Dependent Drop Down Lists does not accept values

    Hi all I have downloaded the next file. It has a userform that makes a dropdown list for each column and it filters the results (Which i belive it's very cool) The problem comes when i perform some changes to the database, in where i put some values for the last column, as you can see in the...
  4. D

    How to make a sql connection to CSV file from Excel VBA?

    I need to connect to CSV file in my downloads folder using SQL query from Excel VBA. This is the code I found from internet Sub SQLconnectCSV() Dim xlcon As ADODB.Connection Dim xlrs As ADODB.Recordset Set xlcon = New ADODB.Connection Set xlrs = New ADODB.Recordset...
  5. Z

    SQL Server query to Power Query - efficiency

    Hi, Tell me please how SQL database queries generated from MS Excel and loaded directly into Power Query works (via Data> Get Data> From Database> From SQL Server Database). Does the query generated this way run slower and overload the database more than if I wrote a SQL query by hand? Let's...
  6. R

    Disable external data connection for other users

    Hi, I’m using a simple notepad .vbs macro to refresh all spreadsheets in the folder which is scheduled to refresh twice a day by task scheduler. The data source of the report is SQL server and hence I’ll have to leave OLE DB refresh option enabled to make sure the data remains up-to-date. When a...
  7. A

    SQL remove header row from query

    Hello all, Is there a way to remove the header row on my output in a sql query? I just having to manually delete it. Thanks
  8. A

    SQL replace question

    hello all, I have this functioning SQL code: SELECT LOANMAST.BANK, LOANMAST.BRANCH, LOANMAST.LOAN_NBR, USERF.USER13A, LOANMAST.POSTDATE, LOANMAST.LOAN_AMT, LOANMAST.SHORT_NAME --USER13A must say "D" in all rows FROM LOANMAST LOANMAST LEFT OUTER JOIN BORRLIST BORRLIST ON...
  9. L

    SQL Statement - Check the earliest date as per group of records - If true , return custom text in a custom column

    Guys I have the following problem. I need to identify if the date of the record is the earliest date of the group. The idea is NOT return an aggregation table, the idea is return all the records but in a custom column I want to identify if the date of the record is the earliest of the group. If...
  10. J

    ADO Query to Check List from another List

    I am trying to filter my Excel table records based on a field which is composed of list separated by a comma. I tried to use a public UDF on my Excel module that returns a boolean to add a condition to my SQL query but I found out that it is not possible. I've got runtime error Undefined...
  11. A

    Have SQL code refer to cells in worksheet

    Hello all, I'm looking to enter the below query from a sql server database. However, in the Enter Connotes section, rather than entering in a list of connotes into the code, I would like for it to refer to a list of connotes in the excel workbook. I would appreciate it if someone could advise...
  12. A

    Issue Connecting to SQL DataBase with VBA

    Hello all, I found what I thought was a working SQL solution, but I am still having errors. I get run time error saying server does not exist or access denied. Sub sqlmaybe() 'Initializes variables Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset Dim ConnectionString As String...
  13. O

    to link the tables in MS Access FE from SQL Server and then share FE for multi user environment

    Dear friends, I am struggling for creating a ODBC data source and then link my table from SQL server. I will tell step by step what I did so far. 1- I have completed MS Access as a compact application (BE+FE) Therefore, it is not available to be used. 2- I requested my IT department of my...
  14. K

    SQL Query to a table in another excel workbook

    Morning all, I have a question regarding SQL queries when creating a data connection. I have created a data connection to an external workbook to a sheet that has a table in it. This table starts at row 13 (the headers) and is a dynamic table that gets updated from time to time. In my query...
  15. J

    Excel - Wildcard match with multiple criteria?

    I have a database spreadsheet where I need to pull key information from the master data. As you can see in the below screenshots, the goal is to return the "Part Number" and the only data I can match with are the "Kenn" and the "Part Code", "Kenn" can be directly matched with "KENN No" from the...
  16. S

    SQL Help - Duplicate IDs

    I have the 2 tables below: Table1 ID Start Date End Date ABC123 01/04/2020 13/09/2020 DEF456 03/01/2020 17/02/2020 ABC123 15/09/2020 30/09/2020 Table2 ID Start Date End Date ABC123 17/12/2019 12/07/2020 ABC123 13/07/2020 11/11/2020 DEF456 07/07/2020 09/09/2020 DEF456...
  17. P

    VBA SQL Update with apostrophe in Text Field

    Using the code below, everything works well until one of the CompanyName values have an apostrophe in it. VBA generates an error. For Example: CompanyName = "John's Plumbing Supplies" How can I modify the code to be able to update the CompanyName Field in Access when the string has an...
  18. M

    How to keep a set of Excel ranges in sync with a set of database tables

    Hi folks, I'm trying to find the best/least-kludgey way to keep a set of Excel ranges in sync with a set of database tables (can be SQL server or MySQL) Here are the requirements: It must be a one way sync, Excel -> database It doesn't have to be an immediate sync, for example a macro...
  19. S

    Pass Parameter from Excel Cell to SQL Query

    Hi I have a query in SQL, an excerpt of which might look something like DECLARE @myDate DATETIME SET @myDate = '2020-10-31' SELECT * FROM myTable WHERE myDate <= @myDate + 1 I want to populate a cell in Excel (e.g. A1) named range "myCell" that will feed through to the SQL variable instead...
  20. J

    ODBC--call failed #241

    Hi, We're currently using Access 2013 to manage some data and it need to reference some other information from SQL Server. This normally isn't an issue. I've written a view that we can use as a linked table to pull selected data into Access but some users (not all) are getting the error...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top