Questions tagged [ms-query]

Microsoft Query is a program for retrieving data from external sources into other Microsoft Office programs — in particular, Microsoft Excel

Microsoft Query is a program for bringing data from external sources into other Microsoft Office programs — in particular, Microsoft Excel. By using Query to retrieve data from your corporate databases and files, you don't have to retype the data you want to analyze in Excel. You can also update your Excel reports and summaries automatically from the original source database whenever the database is updated with new information.

Types of databases that you can access

You can retrieve data from several types of databases, including Microsoft Office Access, Microsoft SQL Server, and Microsoft SQL Server OLAP Services. You can also retrieve data from Excel workbooks and from text files.

Microsoft Office provides drivers that you can use to retrieve data from the following data sources:

  • Microsoft SQL Server Analysis Services (OLAP provider)
  • Microsoft Office Access
  • dBASE
  • Microsoft FoxPro
  • Microsoft Office Excel
  • Oracle
  • Paradox
  • Text file databases
170 questions
40
votes
5 answers

How to add parameters to an external data query in Excel which can't be displayed graphically?

I often use MS Excel's Get External Data to create simple reports - running queries against databases and displaying nicely in Excel. Excel's great features like filtering and pivot tables and familiar interface for users make it quite good for…
Rory
  • 40,559
  • 52
  • 175
  • 261
5
votes
2 answers

CountIf formula within MS Access report

Something terrible as happened with my poor attempt at adding a CountIf forumula to my access report. I am trying to add a formula within my report header to count the number of entries in my Service column that contain a certain word. The problem…
Kris
  • 83
  • 1
  • 2
  • 8
4
votes
3 answers

SQL Query that joins two tables on a prefixed and non prefixed field

I have two tables a and b in my Access Database. In both tables I have the field ID. However in table a my ID field is prefixed with '31' where as my ID field in table b is not. So for example table a table b ID field2 …
ppw
  • 155
  • 4
  • 17
4
votes
1 answer

Using MS Query in Excel to query itself (not an external source)

I can connect the excel file to itself as a datasource for MS Query to work. But as soon as I move the file around the query tries to find it from its previous location on the network and fails. I just want it to try and query itself. I tried…
zoonosis
  • 799
  • 1
  • 11
  • 30
3
votes
1 answer

Connecting to a Plex ERP Database from Power Pivot in MS Excel using an ODBC connection

Below is the error message: DataSource.Error: ODBC: ERROR [42S02] [Plex][ODBC ODBC Report Data Source driver][OpenAccess SDK SQL Engine]Base table:". not found.[10129] Details: DataSourceKind=Odbc DataSourcePath=dsn=Plex ODBC…
jadams0304
  • 31
  • 3
3
votes
1 answer

Calling a SQL Server 2000 Inline Table-Valued Function from Excel 2003 / MS Query

A large part of our user base accesses corporate data by building ODBC queries inside Excel 2003 using Microsoft Query. For the more complex stuff they often get me involved. There have been a number of occasions whereby I've decided that the most…
Wayne Ivory
  • 321
  • 2
  • 8
2
votes
2 answers

Oracle CTE failing in one computer

I have queries created in Microsoft Query to run in Excel with VBA. They work in different computers but there's one computer where it doesn't work. In that computer the queries still work except the ones that use CTEs. A normal query like the…
user7393973
  • 2,270
  • 1
  • 20
  • 58
2
votes
1 answer

Office 2010 query crashes

Office 2010 causes MSQuery to crash when running a big query like this: SELECT TRANSACTION_DETAIL.ACCT_ID, TRANSACTION_DETAIL.ACCT_DESC, TRANSACTION_DETAIL.ACT_COST, TRANSACTION_DETAIL.EMPL_ID, TRANSACTION_DETAIL.EMPL_NAME,…
user634807
  • 21
  • 3
2
votes
2 answers

MSQuery how to inner join 2 tables with allias (excel odbc)

I've been trying to get the last row of each ean (id) because it has several TimeStamps (tmh), but I can't get it on MSQuery with ODBC conexions...Some suggests? SELECT TMH, PESO, ALTO, ANCHO, LARGO, EAN FROM (SELECT TMH219 as TMH, PES219 AS PESO,…
2
votes
4 answers

MS Query - outer join on column 1 LIKE column 2?

Can anyone help me create a left outer join statement to work in MS Query? Based on Hogan's answer, and this MSDN article, I've edited my SQL statement to this (below) but MS Query is still not happy. SELECT CO.MATERIALS1 AS 'Material', …
CBRF23
  • 1,340
  • 1
  • 16
  • 44
2
votes
1 answer

MS Access add/update query result to an existing table base on its ID

I followed the tips by others to produce an access query. I have two tables. See figure1. And the result is figure2. Figure1 http://img.libk.info/f1.png http://img.libk.info/f1.png Figure2 http://img.libk.info/f2.png http://img.libk.info/f2.png The…
Webster H.
  • 35
  • 1
  • 11
2
votes
1 answer

Could not add the table (

The following code works in Sage200. SELECT bcs.BomReference ,bcs.DateTimeCosted ,bcs.TotalCost FROM ( SELECT BomReference ,Max(DateTimeCosted) AS MaxDate FROM NDM_Sage200.dbo.BomCostSession BomCostSession GROUP BY…
Kris
  • 49
  • 2
  • 5
2
votes
3 answers

MS Query with various multiple value parameters where there can be an empty parameter

I have 5 multiple select listboxes in Excel. The selected content of every listbox is each written in one cell, separated with a comma. For example in cell A1 all the selected names: Tim, Miranda, Laura Those cells are the criteria for an Access…
user3061888
  • 21
  • 1
  • 2
2
votes
0 answers

How to get Excel to reliably execute sp_executesql from a query table on a worksheet?

In MS Excel, if you create a QueryTable with Microsoft Query, and your SQL query cannot be visually presented by Microsoft Query, then you are not allowed to provide parameters for that query. Which is a shame, so there is this awesome technique…
GSerg
  • 76,472
  • 17
  • 159
  • 346
2
votes
3 answers

Alternative to Left Join

I need to display the monthly rates for a fixed set of pipelines in Excel 2007 using MS Query and even if a pipeline has no monthly rate it has to be displayed in this manner I have done it using the following code in SQL Server 2008 R2. SELECT…
Ram
  • 3,092
  • 10
  • 40
  • 56
1
2 3
11 12