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

Return results base on calendar Week

I have a table with the following rows. Name Value Links DateSetup Andrew 10000.00 1 2017-06-06 14:00:44.663 Gerard 35000.00 1 2017-06-07 09:56:18.943 Dominic 70000.00 1 2017-06-07 11:35:56.080 Dominic 25000.00 1 …
raymantle
  • 121
  • 1
  • 14
0
votes
1 answer

How do I find Last year same MTD date range in SQL Server?

I am trying to find a MTD data from same month in last year. Can anyone help me to find that date range? If I am pulling a data today, then today MTD will be 4/1/2017 - 4/10/2017 but I am looking for same date range as of last year 4/1/2016 -…
Danny Ryu
  • 39
  • 7
0
votes
0 answers

MS Query executes stored procedure but not returning text

I am executing a stored procedure via MS query to and Macro Enabled Spreadsheet. When I I execute it it returns data except for my two description fields. When I execute the stored procedure in SQL Server, it executes correctly: LEFT('All…
Lucas Perrett
  • 423
  • 1
  • 6
  • 16
0
votes
1 answer

Multiple parameter queries but if left blank, ignore it

I'm trying to create an automated dashboard where users can select what type of report they want to run in Excel, which will then affect the types of parameters in cells which affect a query in MS Access (using the MS Query function). My problem is…
jeden
  • 17
  • 1
  • 1
  • 8
0
votes
2 answers

MS Access Query Calculate Field

I got a table StockMovements which records all movements of my products. It has a field named "Status", which can have either the value Sold or Purchased, Quantity and Product (there are few more but arent important now). I made a query to take all…
X Y
  • 11
  • 1
  • 3
0
votes
1 answer

Why does my LIKE filter only match on one value?

I have this excel file which is giving me unexpected results on an SQL query with a join on LIKE criteria. Here is the SQL statement: SELECT CO.MATERIALS, CO.SIZES, CO.TOOLS, IR.PN, IR.BODYJAW FROM `CROSSJOIN$` CO LEFT JOIN `INSERTS$` IR …
CBRF23
  • 1,340
  • 1
  • 16
  • 44
0
votes
0 answers

MS Access & MS query in excel giving different output

I have a database that has been done in Microsoft Access which joins together 5 tables. I am trying to replicate this in Excel using MS Query. I have gone onto the design view for the query in Access and then copied this in MS query. The tables are…
kit
  • 83
  • 4
  • 16
0
votes
0 answers

ORACLE DB WITH Microsoft Query - LISTAGG

so I have access to the Oracle DB only via Microsfot Query using preconfigured System DSN and I need to select from it multiple rows of data, which all are distinct only by single column. Tables I refer to looks liek this: Tickets ID, time,…
Krzywusek
  • 31
  • 2
0
votes
1 answer

Excel - Microsoft Query - SQL Server login - "Use Trusted Connection" default setting

Couple of years using this site is as an invaluable resource, but first time posting. I am having a little trouble with external data connections in Excel, specifically connecting to SQL Server through Microsoft Query. Whenever I click [Get…
Mike C
  • 11
  • 1
  • 5
0
votes
1 answer

MS Query Incorrect syntax near the keyword 'AS'

I am trying to amend SQL in MS query and the error in the title is being returned when I submit this code. What is wrong with the AS in this case? I could do try to do this elsewhere but it would be simplest if I can get Query to work. Thanks *Or…
Judico
  • 3
  • 4
0
votes
1 answer

How do I disable ms query's auto wrapping of column aliases with quotes in excel 2007?

I'm working on a sheet that accesses a legacy data source via MS Query. I'm trying to alias some of the ridiculously ugly column names but the data source doesn't support wrapping alias names with quotes. Since excel is automatically wrapping…
Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
0
votes
1 answer

UNION ALL with Excel file as data source

I have got the following Problem. I have several Excel files containing each the data of a country in one folder. However I want to pull that all into one Excel report. As the content of the source files change dayly, I guess the best way to do that…
0
votes
1 answer

How to add a summary row with totals in MSSQL query?

Here's the Query SELECT MAX (Supplier.SupplierName) as Supplier, MAX (Department.Name) as Department, MAX (Category.Name) as Category, MAX (ItemClass.ItemLookupCode) as Matrix, MAX (Item.ItemLookupCode) as ItemLookupCode, MAX (Item.Description)…
D.RYU
  • 23
  • 6
0
votes
1 answer

Issue with aggregate function / GROUP BY clause

Hello I am trying to execute the following query in MSSQL and for some reason I cant get the DateTime column when I use MAX(MaxNumberLoggedOnAgentsToHalf) in my select statement. it complains : Column 'Peripheral_Half_Hour.DateTime' is invalid in…
0
votes
1 answer

Excel changes time-format to datetime with MSQuery

I make with Excel a MSQuery to obtain some fields from a table in MySql what is working fine but there is one column which has in MySQL a time-format and Excel delievers me this in datetime-format. I can format the cell in Excel so that it shows me…
Sascha
  • 4,576
  • 3
  • 13
  • 34