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

Subquery Syntax Discrepancy in Microsoft Query

I posted a question last week about using subqueries in Microsoft Query, and although my problem in that instance was not solved, I've found the problem to be much more basic than in that previous case. I'm connected to an Informix database via ODBC…
PriceHardman
  • 1,693
  • 1
  • 12
  • 14
2
votes
0 answers

Schedule automatic update of Excel 2010 file with MS Query data?

I thought this would be easy, but apparently not. I have a stored procedure that returns a dynamic result set. Loading it into excel using Data -> From Other Sources -> MS Query -> exec MyProc gets the data I need into the spreadsheet, formatted…
IronicMuffin
  • 4,182
  • 12
  • 47
  • 90
1
vote
3 answers

Excel create multiple MS Queries using one data connection between two sheets in the same workbook

In Excel 2021, what exactly is a "data connection", "query" and "domain source name"? Let's say I have a Workbook "Manahil_Customer_Database.xlsm" in which I have a sheet "sht_Customer_Cities" that has a table "tbl_Customer_Cities". In a new sheet…
Jawad
  • 8,352
  • 10
  • 40
  • 45
1
vote
2 answers

Using SQL & VBA in MS ACCESS to run a query

I need the correct syntax (with all the quotation marks) for Me.frmButtons.Form.Button01.caption in the SQL-string. This one doesn't work: Private Sub Button01_Click() Dim strsql As String strsql = "SELECT * FROM table01…
Jasco
  • 225
  • 3
  • 8
1
vote
1 answer

Why do I keep getting an error code when I'm trying to run the query?

syntax error in query expression SELECT [Name] FROM MSysObjects WHERE [Type]=5 And Left([Name],1)<>”~” ORDER BY [Name];
Kanesha A
  • 21
  • 1
1
vote
2 answers

Micorosft Access SQL - Counting Number of foreign key records across 3 related tables

I am experienced at VBA but new to SQL. I am developing a test sheet program in MS Access for the plant that I work at. This test sheet program will be used across 3 product lines. When an order is created, it can contain up to all 3 products. The…
JamesHD
  • 11
  • 2
1
vote
0 answers

How do I fix the SQL syntax in my MS Query?

I have two tables I would like to compare using a Microsoft query in Excel. I'm familiar with SQL Server so I used the syntax that works on that program and am getting and error The SELECT statement includes a reserved word or argument name that is…
Tony Bejos
  • 11
  • 2
1
vote
1 answer

OPENROWSET converting phone number in excel sheet to decimal format instead of varchar

One of my field in excel sheet is a phone number and when I bulk import using openrowset and insert it in varchar(50) field it gets converted into decimal format. This is what I am doing: CREATE TABLE dbo.TmpDataFileCC ( field_1 VARCHAR(500)…
Deepak Yadav
  • 1,724
  • 3
  • 23
  • 38
1
vote
1 answer

Open Microsoft Query file without active connection

I'm completely new to MS-QUERY. I am trying to open .dqy file in MS-Query. When opening the file, I get an error mentioning: Name of datasource is not found or no default ODBC-driver is selected. I understand that because this is an older file,…
Sunfile
  • 101
  • 1
  • 4
  • 22
1
vote
1 answer

MS SQL Excel of Excel Files, Case Statements or Alternative

I have an excel file I'm using to process data. It comes in via a .csv file and I wanted to output quite a few different sheets each having processed the data in different ways. Once the initial setup is complete, the person executing this task will…
Golden Ratio
  • 349
  • 2
  • 14
1
vote
0 answers

How to select the most recent observation based on certain criteria on the previous observed date

community, I have a problem in creating a table that gives the latest reported observation for a loan. I created a sample code to run. declare @table1 table ( reference_date int , Loan_id varchar(20) , maturity int , status_loan int ,…
AndreaB
  • 61
  • 1
  • 6
1
vote
1 answer

Excel - Off Page Reference to Microsoft Query

I am utilizing Microsoft Query in Excel to tap into an ERP table structure like Crystal would do. In writing the SQL, is there a way to have a filter pulled from the active Excel worksheet that is embedded in the SQL instead of prompting and…
Corey B
  • 11
  • 1
1
vote
1 answer

Access query is asking for parameters for calculated field, how can I stop this?

I have a query set to calculate units processed per hour by user. The query returns the correct numbers when I run it, however every time that I run it , it will ask for parameters for two fields and I just click "ok". When I link the query to a…
Komakino_1251
  • 220
  • 2
  • 13
1
vote
1 answer

Using date parameters in a FoxPro query through Microsoft Query/Excel

I've got a external data source setup in Microsoft Excel which queries an external FoxPro database via Microsoft Query. One of the lines in the query is WHERE (ihead.ih_date>={d '2018-10-01'}) but I want to change this date to be a parameter driven…
Richard
  • 316
  • 4
  • 13
1
vote
2 answers

SQL AverageIFS Equivalent for Query

So I'm extremely new to using SQL. This syntax formatting is offensive but I am editing it in notepad and can't figure out a better alternative. I want it in the .dqy format but I don't know how else to edit. So if you have a suggestion please…
Matt Cottrill
  • 152
  • 1
  • 1
  • 15
1
2
3
11 12