sql

  1. B

    SQL statement is give me error 3061 Too few parameters. Expected 1

    The SQL statement works in the query grid but not in the vba. I want a search box to pop up and I will enter the EquipID into the search box then it will load the correct records into a list box for that EquipID. See below for the SQL Statement. strSQL = "SELECT tblTag.TagNumber, tblTag.TagID...
  2. R

    Using SQL in VBA LEFT JOIN to fetch data from multiple sheet

    Hi Expert, I have three sheets of data using LEFT JOIN i am supposed to pull the required columns as result. This is the main motive. With the help of this link https://analystcave.com/excel-using-...on-excel-data/ i took the code which does connection to my excel sheets. I need an experts...
  3. M

    Comment column with updated or inserted

    Hi All, I have a excel sheet with the connectivity with the sql server. I use this sheet to insert,Update, delete data from the sql server. Now I'm trying to add a column in this which says if the row was inserted or updated in the database. Can anybody please guide me ho to do this? Thankyou
  4. B

    MS SQL connection that will work in Windows and Mac version of Excel Office 365.

    I have a spreadsheet that retrieves data from a SQL server. I can get it to work in Windows but when I try it on the Mac it fails and when I get it working on the Mac it fails in Windows. Is there a way to create a connection that will work in either version? Windows has to be trusted...
  5. D

    data connection from several databases same model same SQL

    hi I want to get data from SQL, the problem is that in this SQL there are several databases each for different company the tables and model in each database in the same SQL host is exactly the same I do not need one data base but several all together finally I wish to create dashboard and...
  6. J

    Using Vlookup/If to extract values from one named cell in a big data spread sheet

    Hi, I am wondering how I can easily extract wanted data from a spread sheet that is connected to a SQL-database sorting values in random order. Lets say the data is sorted like his: (as you can see, they are not sorted with same intervals all the time) 1 A E 2 Savings...
  7. A

    Create SQL table from Excel VBA

    Hello - I have the following table in Excel <tbody> SLCo SL CompCode APRef Amount Release 101 19 CM 967 5000 101 19001-01P CM 19001-0719 10500 X 101 123546-A CM 123658-1 15000 X 101 56875-4 CM 9856-7A 7500 X 101 32587-4 CM 5647-8 21500 </tbody> Using VBA on a button, I'd like...
  8. N

    Automate Export Data from Excel to SQL

    I am trying to export (and automate) a VBA excel file to SQL . So I tried to configure an Excel data source as a linked server But I got the following issue: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) ADDITIONAL INFORMATION: An exception occurred...
  9. M

    Syntax error in UPDATE statement using ADO

    I've looked everywhere for a solution to this issue with no luck. I'm using ADO to connect a workbook to a second workbook and then update certain fields in the second workbook. I can get this to work perfectly on any data type except a date. The second workbook has a column called Timestamp...
  10. J

    Query linked SQL Server from Excel VBA?

    We have a set of Excel files that query a SQL Server database. They were all created from a template and all use the same connection string. Now that server is being decommissioned and the new server will follow a different naming convention, so the server name will change. The problem is that...
  11. M

    SQL to multiply value from previous record ? How ?

    Pls help... I have a table like this ID , Rate ========== 1, 0.2 2, 0.5 3, 0.3 I want the query ID , Rate, result ========== 1, 0.2, 0.2 2, 0.5 , 0.1 3, 0.3, 0.03 What is the SQL to achieve this ? Any idea and interim table needed ? ie, accumulate multiplication (instead of sum) is...
  12. K

    ADODB Connection referring to Local path NOT Network

    Hello, I've been trying to fix this all day with no luck. The goal of this code is to use a function to look up a value in a table in an Access database (.accdb) and return a different value. I am running the code below, and the adoCN works just fine. It creates a locked .accdb file showing...
  13. M

    INSERT INTO SELECT * FROM tblName IN 'Db Location'

    Hi, I'm trying to consolidate data from multiple access databases into SQL Server. The code works fine but the only drawback is when there is a new column in a source access database table 'Db Location' it results into an error. Is there a way in SQL where I can specify to SKIP unmatched fields?
  14. G

    VBA - SQL Database - ActiveSheet.Name

    Hi, Straight to the point but here is the code stADO = "Provider=SQLOLEDB;Data Source=UKD1-ENG-01;Initial Catalog=" & ActiveSheet.Name & "WWALMDB;User ID=SA;Password=*****" Basically this works, however instead of it pulling from: (sheet name)WWALMDB i would like it to pull from...
  15. D

    Excel parameterized SQL query with IN clause

    Hi! I'm running Office365 package Excel 2016 with MS Query to DB2 SQL database with the query being parameterized towards a specific Excel cell value (although I need to populate this cell from a larger range first). While SQL clauses work fine when cell has a single value, I need to run SQL IN...
  16. P

    SQL Query on PowerPivot Data Model through VBA?

    Hi all - I'm in the process of developing an MI dashboard for a set of business users, and I often get requests from these users for basic reports for the granular data. I want to build a self service reporting tool within this dashboard; The solution that I envisage is a worksheet with form...
  17. M

    MAC Question: Microsoft ActiveX Data Objects

    I code almost exclusively for PC, but occasionally have to code for MAC. I often write SQL to query data and I typically use the Microsoft ActiveX Data Objects 6.1 Library. When running such code on the MAC, the user received a Can't find project or library error. This occurred on the line of...
  18. V

    Help with SQL code within Excel

    Hi guys, I hope you can help me with the SQL query below that I am running in Excel via the Data->Connection, error: Syntax error in FROM clause. Long story short, I used to do a data dump from our database into MS Access and then run the SQL code below from within Excel. It still works nicely...
  19. H

    Query to Identify Records with Different Values in Specific Field

    I need some help. I'm really new to SQL. I’m not sure what I'm missing here and why this isn’t working. Background: I have 2 tables related by an “ID_Key”. Each table contains an ExpDt field which represents an expiration date. These expiration dates may be different between these two...
  20. A

    SQL to VBA

    Hello all, I've been reading (lurking) these boards for a while now - all help so far has been much appreciated however, I now need something that I couldn't already find! I have been given an SQL query and asked if I can pull this data into Excel rather than having to use SQL Dev and emailing...

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