sql

  1. 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 '" &...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. vijnanamatrata

    Recreating NTILE function on running SQL in Excel

    I am making a conversion from traditional way of creating reports in Excel, and I have been stuck on recreating NTILE function when running SQL in Excel (because NTILE function does not exist there), even though I have succeeded in recreating NTILE function when running in Oracle PL/SQL...
  7. B

    SQL Insert Statement > Start Insert Records from Row(3) and onwards

    Hi Community, I need some help running a SQL statement to insert rows starting at Row #3 . The statement works and will insert records, but I can't get it to start inserting at Row #3 which is messing up the data that's being put into the Access Database. Any guidance? Public Sub ShiftSwap()...
  8. gheyman

    Change Query Sql with VBA

    This is all new to me. I am reading posts and trying to piece together how you change the Sql code of a query using VBA. Here is what I did - but it does not work. In my code the Line that starts with WHERE (((.... turned Red. When I try to run it, I get a message that reads: Compile Error...
  9. D

    SQL Linked table

    Hi All, I am new to SQL but learning quickly. I have a spread sheet that has on tab linked to an external SQL database an several other tabs with static data When I run the following "select * from linked" (this I the linked sql data) I get no results, however if I do "select * from...
  10. bs0d

    ADO SQL Query - Multi Users, Schema Name Required?

    I created an Excel workbook that uses ADO query a database on our SQL server: Set myConn = New ADODB.Connection Set myRS = New ADODB.Recordset strConn = "PROVIDER=SQLOLEDB;DATA SOURCE=db_server_name;INITIAL CATALOG=database_name;INTEGRATED SECURITY=sspi;" myConn.Open strConn...
  11. baitmaster

    SQL calculating two different things from same data

    Hi, I'm trying to use SQL within VBA to calculate several related things at once, but I'm doing something wrong I have 4 columns I'm interested in: ID, Description, Value and Date (see code for exact labels). I want to return a dataset that contains - unique ID - unique Description - sum of all...
  12. S

    Writing sql for a table to extract information for reporting

    HELLO EXPERTS, I NEED TO WRITE A SIMPLE SQL TO EXTRACT DATA FROM A TABLE. TABLE IS ALREADY EXTRACTING DATA FROM MULTIPLE FILES AND IS REFRESHING WELL WHEN DATA IS UPDATED IN SOURCE FILES. NOW FROM THIS TABLE I NEED TO WRITE COUPLE OF COMMANDS / SQL IN DIFFERENT SHEETS / WORKBOOKS WHICH MAY...
  13. C

    Evertything seems to paste only in column A

    I was hoping someone can help me. It seems that lately every time, I copy from a source (such as SQL Server), to Excel it puts everything in to column A, instead of separating everything into the multiple columns like how SQL is showing the data. Before this worked, but it just seems like...
  14. M

    Access Split Database Issue

    I have a Front_DB_A with a table called RS and another Front_DB_B with a table called RS_Hist, both are split databases and have tables linked to the Front_DB_A database. My dilemma until we can move it to SQL Server which we are waiting on is that I have a run a query that will combine both...
  15. J

    Convert HHMMSS to time in VBA?

    Hi, In a database our timevalues are stored like 94500 = 09:45:00 121755 = 12:17:55 58 = 00:00:58 What is the best way to convert these when pulling them via ODBC? Ideally in the SQL query but power query is an option also. Thanks
  16. I

    VBA to update SQL Statement in Power Query?

    I'm on Office 365. I created an ODBC connection to Google BigQuery. After selecting the data source as Google BigQuery, I expand "Advanced Options" and there is an option for "SQL Statement (optional)". I paste my SQL Code in there and run the query, and have it create a table with the results...
  17. M

    VBA Loop until finding a match from temp data from SQL pull

    So I am currently working a project and I and I need to create verify text given through an input box against an SQL result. If the number "15" is entered and the sql table contains 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 I need it to save the number variable if a match is found and if not I need...
  18. S

    Is it possible to avoid refreshing of present data in Excel Query ?

    I am trying to figure out how to continuously pull data from multiple excel files, but not allow excel/query to change manually edited values back to source values Example: I have June, July, August files. I pull these files from folder Sample data is <colgroup><col width="64" span="4"...
  19. baitmaster

    help writing SQL query including Join and Subquery

    I’m working with SQL in Excel, and it’s working well. Now I want to add a new query that’s slightly more complex than the others and is outside my limited SQL comfort range. I have 3 tables (worksheets): Table1 contains JourneyRef, RouteNum, DepTime, ArrTime Table 2 contains RouteNum, Origin &...
  20. S

    MS Access Top N Values Show in Table

    Hi, I have a table in Access which contains sales total. I need only Top 2 Values in each column. My input data is below: <colgroup><col span="8"></colgroup><tbody> Prd_Code Prd_Desc Cat_Code Cat_Desc Q1_Sales Q2_Sales Q3_Sales Q4_Sales 111 ABC 11 A 12 12 87 34 222 DEF 22 B 43 56 56 56...

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