1. 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...
  2. 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" : [ {...
  3. 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...
  4. 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 ?
  5. 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...
  6. 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...
  7. 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...
  8. 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
  9. 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...
  10. 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:=""
  11. 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...
  12. 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...
  13. 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...
  14. gheyman

    Access: Design view problem - only showing SQL

    I am trying to see my query in Design View, but its only coming up in SQL (I am clicking Design View not SQL View). I'm not that good at SQL so I need to see it in Design view. Anyone know how to fix this? Thanks
  15. A

    VBA - too many line continuations

    I have a very long SQL statement which I'm trying to put into my VBA code. In my VBA I have the following format for SQL: With ActiveWorkbook.Connections ("Database").OLEDBConnection .CommandTest = Array ("Select * bla bla bla") I looked through some web information and it was suggested...
  16. A

    SQL statement VBA : need to ignore blank values

    Hello, I have a VBA with an SQL statement. I need to ignore any values that are blank Below is portion of VBA: "SELECT * FROM Data.dbo.Contract_Summary_Workbook as w WHERE w.""ProjectNo"" " & _ "like '" & Lists.Range("C4").Value & "%' or w.""ProjectNo"" like '" &...
  17. A

    Ways to bring data from SQL server but need input parameters for SQL to read

    I was wondering if someone can please help me on best way to use parametirized SQL query and bring it to Power Query. I have access to SQL server with known connection string. SQL is long and needs to use specific input parameters (project numbers) in it. I don't want to have them changed each...
  18. S

    Scheduling Possibilities?

    Hello, I have Power BI Pro installed as part of our E5 license and I am trying to evaluate it in thoughts of using it instead of our current IBM Cognos setup (that we pay extra for) fo rquerying our SQL server tables... However, the one concern I have that I do not think Power BI can do - but...
  19. B

    Concatenate Records from Record Set (rs) SQL Query from ACCESS Database

    Hi Cummunity, Needing some help to concatenate row values being retrieved from ACCESS Database. INstead of writing to multiple rows, i need to concatenate all the record set values and write it to a single cell. Here is a view of part of my code: Currently there are two rows in the database...
  20. D

    SQL Help - **Newbie**

    Hi ya'll - realizing this isn't an Excel question but hoping someone could help me interpret the output of the following SQL query and how it is structured. Here is some information about the database: - conversations_conversation records represent a single conversation between two people...

Some videos you may like

This Week's Hot Topics