sql

  1. 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:=""
  2. 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...
  3. 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...
  4. 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...
  5. 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
  6. 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...
  7. 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 '" &...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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()...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top