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

Adding extra fields to a query

Hi, this is going to be slightly vague,
but a general question.


I have a simple query that returns:
FILE NAME | FILE TYPE | 2004 USAGE


but now, I want to join the following columns:
2005 USAGE | 2006 USAGE


How do I get it to join the two extra fields to my rows?
and also, what happens if 2005/2006 usage is Null, will that be a problem?


Thanks very much,
k40
Aug 15 '07 #1
1 1386
pbmods
5,821 Expert 4TB
Heya, k40.

Simply add the other two fields to your SELECT clause:
Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.         `FILE NAME`,
  3.         `FILE TYPE`,
  4.         `2004 USAGE`,
  5.         `2005 USAGE`,
  6.         `2006 USAGE`
  7.     FROM
  8.  
  9.     .
  10.     .
  11.     .
  12.  
Or did you need to add additional tables to a join?

PS. Changed thread title to better describe the problem (did you know that threads whose titles contain three words or less actually get FEWER responses?).
Aug 15 '07 #2

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

Similar topics

0
by: Jack | last post by:
Hi, I got a code that is supposed to build first column as blank and then columns corresponding to the query. However, the final result is coming with one extra column where the vendor code values...
4
by: Tryfon Gavriel | last post by:
Hi all I recently noticed when trying to optimise a major query of a chess website I am the webmaster of, that adding an order by for "gamenumber" which is a clustered index field as in for...
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
1
by: Trent | last post by:
I am in the design phase of a new database and am having a devil of a time with a subform. I have three tables that relate to problem - Suppliers tbl, Customers tbl and a SuppliersCustomers tbl....
2
by: Viorel | last post by:
Adding new row with default values. In order to insert programmatically a new row into a database table, without direct "INSERT INTO" SQL statement, I use the well-known DataTable.NewRow,...
3
by: dchristjohn | last post by:
I am currently developing a small windows application using Visual Basic via Visual Studio 2005. My database resides on a SQL 2000 server. I have a table with three fields: id (int, Not Null)...
0
by: New to Perl | last post by:
I'm practically still a newbie at access and I need some help ! Right now I created a tabbed form which initially is based on 1 query. However, the query has reached its limit & i had to add...
2
by: jkwok | last post by:
Hi, I have a table that needs extra attributes added to it after a certain amount of processing has been completed. For example Table A has two fields x and y. A x y And now, I need to...
2
by: trixxnixon | last post by:
ok i have a query that pulls its parameters from a form. If a filed on the parameter form is blank, or is null, the query will search without using a parameter. To do this I use the !! or (!!is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.