sql

  1. 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
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. M

    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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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" : [ {...

Watch MrExcel Video

This Week's Hot Topics

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
Top