sql

  1. 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...
  2. 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...
  3. 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...
  4. R

    SQL (Multiple If / Not Like) Statements

    Hello. I have the following code. Which I can't get it to work. All of the code works until I get to the OR statements. Not sure if I need a case statement or ? Any input would be much appreciated ! Thanks. select a.agree_no as agreement_no, a.um_agree_no as umbrella, a.agree_class as...
  5. B

    Select Query based on day of the week

    I have a query that every day pulls yesterday's data from an sql database and drops it into Access. SELECT Date, InvoiceNo, Customer FROM SalesDatabase WHERE Date=Yesterdaysdate What I need it to do though is when today's date is a Monday, I need it to gather the data for Friday, Saturday...
  6. B

    VBA SQL Query ACCESS DB w/ LIKE "*" Operator

    Hi Community, Looking for some help in solving a problem. I am getting back a NULL (no records it seems) when processing this query in VBA, but when i try it similarly in Acess it works the way it's supposed to. Not sure what i am doing wrong here. Any help would be appreciated. VBA SQL...
  7. S

    VBA Dynamic WHERE clause in a SQL statement

    Hi, I'm trying to connect to an SQLite database that contains financial information about various companies. The code will then put the information into a worksheet for me. Currently I am having to hard code the symbol of the company that I am wanting to search in the database for. This works...
  8. D

    Excel vba SQL query with datediff

    I have a SQL database with a date that is text format. I convert to a date on query the use datediff to see if another date is greater than 90 days different. I don't get a error yet it does not remove the SQL entries that are greater than 90 days sql = "SELECT * FROM PipelineList WHERE...
  9. B

    How to make PB query as a JSON and send to remote server via REST?

    Hello there, I am querying a remote PB server by doing a POST to its REST url (something like https://XYZ/public/reports/querydata). The query is contained in a JSON file which looks like this { "queries" : [ { "ApplicationContext" : { "Sources" : [ {...
  10. S

    SQL in VBA help

    HI, I am having issues with my current SQL Statement. my immediate window is throwing the current error: "-2147217900:Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'." I am trying to determine the number of records in the Dates table based on two fields...
  11. S

    Is it possible to write queries in Excel data model for tables ?

    I have several tables (different data) in my Excel data model and I want to JOIN them with a manual sql query. Is it possible ? If it is, how to do it ?
  12. K

    Merging a SQL Table and an Excel Table

    Hello, I'm just entering the world of connecting to SQL via Excel, so please bear with me if I don't get any of this terminology right. I'm trying to merge live sales data that I import from SQL with static cost values that I track within the same workbook. In my previous iteration of this...
  13. D

    SQL in VBA Excel to query multiple tables in Access database

    Hi guys, I have an Access database with the following tables - Clients, IT2019, IT2018, IT2017, IT2016 etc. A client can exist in multiple IT... tables, or just one (depending on when a client joined). All tables use the field ClientCode to identify clients (This is the primary key in all...
  14. J

    Reference Libraries Disappear at Startup

    I have to enable the following reference library to execute SQL commands in VBA. While I have added my UDF into my startup workbook, the reference library becomes unchecked every time I open and close Excel? How do I get it to stay added whenever I open my startup workbook? Libary: Microsoft...
  15. S

    Unable to add new line with "Enter" in Table Import Wizard (Data Model)

    Whenever I press Enter to start a new line it returns me back to Edit Table Properties. Is it a normal thing ? Is there a way to use Enter as a new line command ? na
  16. J

    Type Id and search record directly in sql

    Hi there to all Mr Excelssss men. Ok, i know we can type an sql query and bring data to our excel. What a want to do, is to type something, which in this case is an Invoice ID number, and that triggers sql query and give me back some fields. I actually have the query that brings all the records...
  17. C

    Where in SQL

    Was wondering how I can use a Where statement in a SQL qry Am doing a mail merge, and trying to avoid the rows in the Name column that only contain a function that returns "" SQLStatement:="SELECT * FROM `" & wsName & "$`", SQLStatement1:=""
  18. J

    VBA and SQL

    I have to insert some data into an .mdb file from an excel worksheet. The ADO connection was created successfully. The 'insert into' query has to be combined with 'where not exists' to avoid inserting duplicate data. I have to select some data from a worksheet of the active workbook (say 'c') to...
  19. S

    Use VBA to generate SQL reports

    Hi I need help in writing a vba code which would connect to SQL and run a SQL statement to generate a report based on company name. The code should then save the output to the defined location in the excel data table The data table in excel has company names from b2:b50. Column C is a user...
  20. A

    VBA grammar for sum of two fields in SQL table

    I have an SQL statement that sums up two fields and is working find in SQL Select w.Forecasted_hours + w.actual_hours as 'TotalForecast' however in VBA I'm not exactly sure what would be the right way to do it. If I paste the SQL it seem like not recognizing a plus sign. Can anybody please...

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