Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 358
Default Change MS Access query from Excel

Thanks dmoney.

I thought I'd keep my question simple but I can it just created confusion
judging by the two replies I've received.

My real requirement is to update a pivot table in excel. The source data
currently comes from MS Query and has been looking at a table based on the
Dept_No.
The SQL is:
"SELECT tbl_Comm_Data.[Commitment Status],
tbl_Comm_Data.CURR_DATE FROM Tbl_Dept_No INNER JOIN tbl_Comm_Data ON
Tbl_Dept_No.The_Dept = tbl_Comm_Data.DEPT_NO;"

There are some occaisions when the query needs to be based on the following.

"SELECT tbl_Comm_Data.[Commitment Status],
tbl_Comm_Data.CURR_DATE FROM Tbl_Report_Periods INNER JOIN (Tbl_Dept_No INNER
JOIN tbl_Comm_Data ON Tbl_Dept_No.The_Dept = tbl_Comm_Data.DEPT_NO) ON
Tbl_Report_Periods.REPORT_PERIOD = tbl_Comm_Data.REPORT_PERIOD;"

I have raised a question on how to modify the SQL in MS Query but no-one has
replied. I then thought if I could change a query (qry_Excel_Data) in access
from excel I could have the pivot tables look in Access for this query and
bypass MS Query altogether.

Hope you can assist.


--
Andrew


"dmoney" wrote:

are u trying to make the access query save or just trying to select more
information from the access table? Your select statement should work, but
how are u putting the information into excel? or are you. --- If you are
trying to litterally change the access querry, you cannot use a select
statement, u will need to use a create routine instead. The select statement
is used to querry the database not change it. If the dbase that you are
querrying has the fields you need then the select statement you wrote will
work fine followed by a open and recordset commands to put the data in Excel.

"Andrew" wrote:

Hi,

Can someone please put me out of my misery. I've been working on this for
hours.

In an Access database called 'TEST.mdb' I have a query called 'qry_My_Test'.
I want to change the 'criteria'

From

SELECT Tbl_Comm_Data.DEPT_NO FROM Tbl_Comm_Data;

To

SELECT Tbl_Comm_Data.DEPT_NO, Tbl_Comm_Data.DEPT_NAME FROM Tbl_Comm_Data;

Thanks


--
Andrew
221108

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using excel to access MS Access saved query matelot Excel Programming 1 April 19th 08 01:29 AM
Can I use MS Query in Excel like an Append Query in Access Sam Wardill Excel Discussion (Misc queries) 0 April 11th 06 02:41 PM
Run Access query from Excel, input value to query being value in c Nagesh Excel Programming 3 December 22nd 05 02:00 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
Using InputBox to change query criteria in Access JohnBoy Excel Programming 2 September 16th 03 02:08 PM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"