473,394 Members | 1,794 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,394 software developers and data experts.

Trouble with database query

Hi Everyone!

I've been desperately trying to prepare a database query from Access to Excel. The problem is, when I ask MS Query to import data from more than one table, no data is importing, only the headings. The SQL is as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT Expense.Rent, Expense.Utilities, Assets.Cash, 
  2. FROM `C:\My Documents\Accounts`.Expense Expense, ‘C:\My Documents/Accounts’.Assets Assets 
  3. WHERE TransactionID = TransactionID
Everything works fine when I import from only the Expense or Assets tables, but not from both. I only need the last line of the database, so is there some way to import just one line instead of every entry?

Thanks so much for everyone's help!
Jan 25 '07 #1
2 1396
MMcCarthy
14,534 Expert Mod 8TB
Don't know if this will work with Ms Query ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT Expense.Rent, Expense.Utilities, Assets.Cash, 
  3. FROM `C:\My Documents\Accounts`.Expense Expense As E INNER JOIN ‘C:\My Documents/Accounts’.Assets Assets As A
  4. ON E.TransactionID = A.TransactionID
You could try designing the query in Access and using the query as the source instead.
Jan 25 '07 #2
NeoPa
32,556 Expert Mod 16PB
You might want to change the SELECT line of Mary's improved code to :
Expand|Select|Wrap|Line Numbers
  1. SELECT E.Rent, E.Utilities, A.Cash
Also look at the quotes used in your FROM clause. When shown in [ CODE ] tags they are not all the same (The Expense link uses incorrect quote characters).
Your final code may look like :
Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT E.Rent, E.Utilities, A.Cash
  3. FROM 'C:\My Documents\Accounts'.Expense As E
  4.   INNER JOIN ‘C:\My Documents/Accounts’.Assets As A
  5.   ON E.TransactionID = A.TransactionID
Jan 27 '07 #3

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

Similar topics

11
by: Jim Willsher | last post by:
Hi all, PHP 4.2.2 on RedHat9 I have some files on my website for people to download, and I want to generate the file location "on the fly", so the URL is held in a database. I have a simple...
2
by: Alistair | last post by:
Hi there, New to PHP. I have always used ASP. I am having trouble trying to do the things in PHP the way (or similar) i did it in ASP. In ASP I used an Access database. I now use a mySQL...
14
by: BlackHawke | last post by:
My Name is Nick Soutter, I am the owner of a small game company, Aepox Games (We're in the middle of a name change from "Lamar Games"), www.lamargames.net. Our first commercial game,...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
3
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key...
0
by: harry12 | last post by:
Hello- I'm fairly new at using Microsoft Access and I'm having trouble getting a couple of things to work in my database. The first is that I have yet to find a way to get an append query to...
2
by: XVI | last post by:
Hi, I am working with 3 acces 2000 database. I have make 20 query to extract informations on these database. The 3 database have the same structure and datatype bot not the same records. When I...
7
by: rodeoval | last post by:
hi! I'm completely new to PHP and MySQL and I am using WAMP 5.This is something I extracted from a web tutorial. Although it is to create a table called students in a database named College it does...
1
by: George | last post by:
I have just loaded Access 2007 and am having trouble creating a new database where I update my table from a query. I have done this numerous times in years past but am totally frustrated tryng to...
2
by: gerrybytes | last post by:
I am using a form in html as a login. However when passing this info php to be validated I get an error from mysql statements. A point in the right direction would be of great help. I've been...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.