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

show tow desimals after MS SQL

Hi I have some problem which I can't solve, maybe some of you can help me I need to show result of division. select 50/200 as we all know it supposed be 0.25, however, I got 0 so them i try this SELECT ROUND(CAST(50 AS NUMERIC(18,2) )/ CAST(200…
Andrey
  • 1,629
  • 13
  • 37
  • 65
0
votes
1 answer

Using 'AS' Statement in MS QUERY SQL with 'UNION ALL'

My company has a dual company structure which requires that data be kept separate. We have two datasets which are identical in structure. I commonly use MS Query to write SQL using one dataset, and when I have what I want, I simply add a UNION ALL…
0
votes
1 answer

Issue setting parameters in MS Query

I have an Access database that is connecting to an Excel dashboard. I have a query that performs a task, but needs a few dates set as criteria before it can complete the query. I'm using parameters to point to a few spots within the dashboard to…
Jcmoney1010
  • 912
  • 7
  • 18
  • 41
0
votes
1 answer

SQL Query returns comma separated data

I am running the below query through MS Query on an ODBC connection: SELECT oa_cstexpbal_0.costcentre, oa_cstexpbal_0.expensecode, oa_cstexpbal_0.yearno, oa_cstexpbal_0.baltype, oa_cstexpbal_0.openbal, oa_cstexpbal_0.periodbal FROM…
PIPRON79
  • 131
  • 1
  • 1
  • 11
0
votes
1 answer

MS Query Command Text Parameter

Using MS Query to retreive data in to Excel. Can i use a cell value as a parameter in the Where clause of the 'Command Text' in the MS Query Connection Properties? What would be the correct syntax to use if this it possible? I have tried variations…
user3673417
  • 179
  • 1
  • 4
  • 18
0
votes
3 answers

How to do a MS Access Update query for a table in external database

Im trying to perform an update query on a table that its on a separate database, so far i have this SQL: UPDATE [;database=C:\QA_Daily_YTD_Report_Export.accdb].[YTD-Daily_Report] AS EXT_DB SET EXT_DB.Category1 = "1" WHERE (EXT_DB.Category1 =…
0
votes
4 answers

How to create copy of database using backup and restore

Using SQL Server Management Studio 2012, I'm trying to create a copy of a local database. I found a few variants of solution. One of them - backup and restore database as new one - HERE. Currently create database backup with name Rewards2_bak. This…
hbk
  • 10,908
  • 11
  • 91
  • 124
0
votes
1 answer

More difficulty returning only the latest data in MS query

I am reposting this question. I have cleaned up the SQL but there are still a few duplicate results. I need to find the most recent data for each itemnum in each location. Here's what I have: SELECT invbalances.itemnum, invbalances.curbal,…
0
votes
2 answers

Return only latest entry in Database query containg multiple linked tables

I am seriously out of my depth on this one... I have a MS Query with 3 linked tables returning multiple results. I need to limit them to the most recent entry because the data is too large to import into Excel as it stands. Here is a copy of the…
0
votes
1 answer

MS Access Query Dlookup using Like?

I have two Tables. "RPT_CHG" and "OPTIONS". In RPT_CHG, If the field [USER2] can be found in the Table OPTIONS Field [ApplyToProductCodes] Then I want it to return to me a list of ID's that contain [USER2] in [ApplyToPRoductCodes] (I.E. RPT_CHG…
Detailmp3
  • 1
  • 1
0
votes
1 answer

Multifield Search, Incorporating age range criteria?

I'm trying to add a multifield search into a form, but I ran into a jam. I have it figured out for my 4 text fields. Here's the code I use utilizing wildcards so that it searches all records if it's left blank Like "*" & [Forms]![Patient…
user2744572
  • 21
  • 1
  • 9
0
votes
1 answer

MS Access- Table normalization and query design problems

I have a tricky thing I'm trying to get working I have a table that contains events, and 10 fields populated with ID Numbers of employees who attended, and a comment box for each one. I tried to create a query that uses a combo-box with the ID…
user2744572
  • 21
  • 1
  • 9
0
votes
0 answers

How do I extract SQL code from MSQuery using VBA?

Is there a way through VBA to be able to look for a querytable in a workbook and return the SQL code (as a string), as displayed within MSQuery? I have to do this a fair bit and its a pain having to go into Edit Query, wait for it to load, press…
bmgh1985
  • 779
  • 1
  • 14
  • 38
0
votes
1 answer

Simple SQL Statement query using IIF

I am trying to report a simple 3 column query using MS Query from a single Table, The 3 columns are 'Sales Person [EXECNAME]', 'No of Cars Sold [ITEM]', 'No of Cars That had Finance on it' [FINANCECASES]. There is no field which simply shows YES for…
0
votes
1 answer

how to join 2 query into one in EXCEL ORACLE CONNECTION

I have 2 query. I am trying to join them so I just write export from one instead of manually joining them in excel. (SELECT b.OUT_NO, a.ACCNO, a.BILL_ACCNO, a.NAME, a.HOUSE_NO, a.STREET, …
user206168
  • 1,015
  • 5
  • 20
  • 40