473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Problem Getting External Data in Excel, From Access

119 100+
I am trying to import data into excel via a query through the functionality found at:

Data -> Import External Data -> New Database Query

Unfortunately, the query I am trying to import contains a user defined function, ClearingCost:

Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_ParentOrder.ParentID, tbl_ParentOrder.Qty, [qty]*[costpershare] AS RawCost, ClearingCost([qty]) AS Cost
  2. FROM tbl_ParentOrder, tblClearingCosts;
Excel does not like this.

Does anyone know of a way of importing a query that contains a user defined function, or a work-around?

Thanks!
Jul 31 '08 #1
3 4164
Stewart Ross
2,545 Expert Mod 2GB
Hi. I would turn this one around, so that instead of importing Access data into Excel using Excel's import facilities you use Access to export the query in Excel format to a specified file, then open the spreadsheet in Excel once it is exported from Access.

Access has no problem with exporting calculated fields, whether based on user-defined functions or those built-in.

-Stewart
Aug 1 '08 #2
billelev
119 100+
Hi. I would turn this one around, so that instead of importing Access data into Excel using Excel's import facilities you use Access to export the query in Excel format to a specified file, then open the spreadsheet in Excel once it is exported from Access.

Access has no problem with exporting calculated fields, whether based on user-defined functions or those built-in.

-Stewart
A good suggestion, Stewart. My only hesitation is that it would be best to have Excel grab the data when needed, rather than relying on Access to output the data at a particular time/event. But I could certainly implement your suggestion.
Aug 1 '08 #3
NeoPa
32,556 Expert Mod 16PB
You could use Application Automation to open the specific database and copy the data in. It's a lot more complicated though, and requires familiarising yourself with the techniques.

Otherwise, I'm afraid Excel (via MS-Query) cannot see the database itself for functions. It can't even use Nz() unless you explicitly add the Reference in the VBA window to MS Access. This is because MS-Query treats the database simply as a back-end data repository rather than an Access application with access to all the code.

PS. How complicated and / or involved is ClearingCost()?
Maybe it could be duplicated in SQL.
Aug 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: N. Graves | last post by:
I'm planning to develop a process to import data from an external flat file to a new table automatically. As usual I'm having a hard time getting started on the solution because of the Access's...
0
by: J. Koskey | last post by:
We're having a problem with the File-Get External Data-Import function on a PC with Access 2000 - it just doesn't work, but gives no error message. When we try to use the File-Get External...
8
by: mytfein | last post by:
Hi Everyone, Background: Another department intends to ftp a .txt file from the mainframe, for me to process. The objective is to write a vb script that would be scheduled to run daily to...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
1
miffe
by: miffe | last post by:
Greetings, I've got an access database on a server, and in a client PC I've got an excel spreadsheet... I run a query from the client PC involving some maths to develop different price lists from...
5
by: srinivas | last post by:
Hi, I have a ASP.net application which takes excel sheet as input.It retrieves the data from the excel sheet and using that data it generates reports. On my PC everything is working fine.But if...
2
by: Andrew W | last post by:
Hi All, I'm trying to link to data on a website with Access. When I try File/ Get External Data/ link tables/ HTML/, I get the following error message: Database or object is read-only. I...
1
by: Haidee | last post by:
Hi I'm pretty new to MS Access so please be patient.... I have a user that is trying to import an external excel spreadsheet into MS access 2003 by using the File - Get external data - Import. ...
2
by: radink | last post by:
I have an established secured access database. I would like to read fields in the Access DB while im in excel via the external database query tools. However im getting an error about not having...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.