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
0
votes
1 answer

Execute valid Oracle DB query in Microsoft Query

I've written an oracle query which executes fine against Oracle 11g DB (I wrote it in PL/SQL developer). But when I try to copy/paste it into Microsoft Query as SQL, it fails with ORA-00900: invalid SQL statement. Is there a list of what can be…
maialithar
  • 3,065
  • 5
  • 27
  • 44
0
votes
0 answers

Refering Workbook cells from MS Query

I have a query in a workbook which SQL statement is: SELECT field1, field2, field3 FROM table Now, I would like to update query to filter data using criteria from my workbook as so: SELECT field1, field2 FROM table WHERE field3 = Sheet1!A1 --…
LS_ᴅᴇᴠ
  • 10,823
  • 1
  • 23
  • 46
0
votes
1 answer

SQL add calculated column to table

I am not fluent in SQL, but I am using Microsoft Query to create a new table from an old table and add a new column (a calculated column). My calculation queries from the same table. I essentially want to retrieve a dollar figure from the same date…
MikeM
  • 11
  • 2
  • 3
0
votes
2 answers

Excel MS Query - How to write parameter equals "" or show all in SQL query

Just finished writing an SQL script in the MS-Query and I'm having difficulty trying to get it to work. What I'm after is the equivalent of this SQL where clause: AND ((examplefield = @Para) or (@Para = '')) So if parameter = something in the…
TJH
  • 189
  • 1
  • 5
  • 18
0
votes
2 answers

SQL Server query to check whether given month and year present in the given date range

I'm using SQL Server 2008. My table structure looks like SNo From_date To_date EmpId ---------------------------------- 1 6/6/2012 2/6/2013 1 2 3/6/2013 NULL 1 3 6/6/2012 5/12/2012 2 When I provide particular…
saranya
  • 179
  • 1
  • 5
  • 16
0
votes
1 answer

How to improve this msquery solution?

Using an Excel xlsx file with 50k+ rows exported from elsewhere. Trying to deal with nulls in msquery I have tried CASE statements with every combination I could imagine (and I am pretty sure it was not the syntax that was the problem) these are…
datatoo
  • 2,019
  • 2
  • 21
  • 28
0
votes
1 answer

Server moved, now MS Excel 2003 queries won't work

We use MS Query to retrieve data from various databases to create management metrics (i.e. within Excel, go to Data...Import External Data...New Database Query). The SQL query and parameters (mostly conn string) are automatically stored by Excel…
Andrew
  • 1,765
  • 2
  • 17
  • 24
0
votes
1 answer

excel, ms-query and datetime parameter to query ms sql server

I'm trying to run a SQL-query in Excel 2010 to MS SQL-Server 2008 with one parameter in DATETIME format: SELECT * FROM mytable WHERE myCreateDate > ? The column myCreateDate is DATETIME in MS SQL-Server. The parameter comes from a cell in…
Ralf Hundewadt
  • 1,078
  • 1
  • 13
  • 25
0
votes
1 answer

SQL Server query, get records with distinct value in 1 field and max in other field

I have a table with some columns: WON param | machine | inputdate | val ---|-------------|------------|------------------|--------| 18 | PAR.SPTDM.X1| MM01 | 20/01/2013 12:43 | 2.5 | 18 | PAR.SPTDM.Y1| MM01 |…
Gunther Struyf
  • 11,158
  • 2
  • 34
  • 58
0
votes
1 answer

SQL Server : Query Missing FROM clause with IIf

I need to run a T-SQL query via the Microsoft Query interface, using an IIf statement. When I run the query, I get the error Missing FROM clause. This is odd, because the FROM clause is there. It fails because of the IIf but I have no idea why. The…
Deep Frozen
  • 2,053
  • 2
  • 25
  • 42
0
votes
3 answers

Excel: filter table rows by specified column value

I have a table with first column as primary key. Ex: id value1 value2 1 10 5 2 2 3 3 12 5 .. I also have a second list of id's I want to select, which can have repeated ids. Ex: selectId 1 2 2 2 5 10 .. How can…
Amro
  • 123,847
  • 25
  • 243
  • 454
0
votes
2 answers

hiding unnecessary fields in Access Report

At my workplace there is a "Daily Feedback" database where details are entered of any errors made by Customer Service Officers (CSOs), such as who made the mistake, when, and what service it was for. this is so we can gather data which would show…
Kris
  • 83
  • 1
  • 2
  • 8
-1
votes
4 answers

How to trim a string which changes at each result

I have data which contains a date and a batch number. I need to be able to trim down the batch number removing the leading word "Job " from each. The issue i have is each result is different and is of a different length also. To try and deal with…
Jack Williams
  • 141
  • 1
  • 1
  • 15
-1
votes
1 answer

Choosing Correct Dates

Please excuse my formatting... I am working on that. I am trying to select the correct price of a project in my query based off the appropriate effective date. For example we have a table that has the following information Price…
James
  • 1
  • 1
-1
votes
1 answer

show one custommer only

i want to make a total sum of the ordered product for on custommer how do i do that? i have the following code $result = mysql_query ("SELECT order_item_name, SUM(product_quantity) FROM wntl_virtuemart_order_items WHERE…
1 2 3
11
12