473,480 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

This query should be easy

I have a simple task to perform that I cannot seem to figure out.

I have two tables:
OR_CUs
OR_CEOs

They share (can be joined on) a field called [CU], which is just the
name of the CU.

All I want to do is get the email address field (EMAIL) from OR_CEOs
and into OR_CUs. Once that's done I will get rid of OR_CEOs. I've
created an empty field in OR_CUs, also called EMAIL.

I've tried UPDATE queries and access always ends up asking me what my
references are (even though they're qualified by the table name). I'm
fairly new to SQL but this seems so elementary. Hah.

Thanks for any help.
John

Jan 12 '07 #1
4 1507
In query designer add both tables.
Join the two tables on [CU]
Put the field that you want to update ([OR_CUs].[email]) in the Field
In Update To put [OR_CEOs].[email]

I personally wouldn't use the letters "OR" in a table name because they
look like OR statements in the SQL.

SQL looks like this:
UPDATE OR_CEOs
INNER JOIN OR_CUs ON OR_CEOs.CU = OR_CUs.CU
SET OR_CUs.Email = OR_CEOs.Email;

Cheers,
Jason Lepack

JohnH wrote:
I have a simple task to perform that I cannot seem to figure out.

I have two tables:
OR_CUs
OR_CEOs

They share (can be joined on) a field called [CU], which is just the
name of the CU.

All I want to do is get the email address field (EMAIL) from OR_CEOs
and into OR_CUs. Once that's done I will get rid of OR_CEOs. I've
created an empty field in OR_CUs, also called EMAIL.

I've tried UPDATE queries and access always ends up asking me what my
references are (even though they're qualified by the table name). I'm
fairly new to SQL but this seems so elementary. Hah.

Thanks for any help.
John
Jan 12 '07 #2
Thanks for your response. I'm having trouble now with case, methinks.
The CU field I'm joining on is all uppercase in one table and lowercase
in the other. I tried adding UCASE( ) for the elements in the ON
clause:

UCASE(OR_CEOs.CU) = UCASE(OR_CUs.CU)

to no avail. Any ideas?
Jason Lepack wrote:
In query designer add both tables.
Join the two tables on [CU]
Put the field that you want to update ([OR_CUs].[email]) in the Field
In Update To put [OR_CEOs].[email]

I personally wouldn't use the letters "OR" in a table name because they
look like OR statements in the SQL.

SQL looks like this:
UPDATE OR_CEOs
INNER JOIN OR_CUs ON OR_CEOs.CU = OR_CUs.CU
SET OR_CUs.Email = OR_CEOs.Email;

Cheers,
Jason Lepack

JohnH wrote:
I have a simple task to perform that I cannot seem to figure out.

I have two tables:
OR_CUs
OR_CEOs

They share (can be joined on) a field called [CU], which is just the
name of the CU.

All I want to do is get the email address field (EMAIL) from OR_CEOs
and into OR_CUs. Once that's done I will get rid of OR_CEOs. I've
created an empty field in OR_CUs, also called EMAIL.

I've tried UPDATE queries and access always ends up asking me what my
references are (even though they're qualified by the table name). I'm
fairly new to SQL but this seems so elementary. Hah.

Thanks for any help.
John
Jan 12 '07 #3
Are there spaces at the start or end of your names? you could try
Trim( )

Cheers,
Jason Lepack

JohnH wrote:
Thanks for your response. I'm having trouble now with case, methinks.
The CU field I'm joining on is all uppercase in one table and lowercase
in the other. I tried adding UCASE( ) for the elements in the ON
clause:

UCASE(OR_CEOs.CU) = UCASE(OR_CUs.CU)

to no avail. Any ideas?
Jason Lepack wrote:
In query designer add both tables.
Join the two tables on [CU]
Put the field that you want to update ([OR_CUs].[email]) in the Field
In Update To put [OR_CEOs].[email]

I personally wouldn't use the letters "OR" in a table name because they
look like OR statements in the SQL.

SQL looks like this:
UPDATE OR_CEOs
INNER JOIN OR_CUs ON OR_CEOs.CU = OR_CUs.CU
SET OR_CUs.Email = OR_CEOs.Email;

Cheers,
Jason Lepack

JohnH wrote:
I have a simple task to perform that I cannot seem to figure out.
>
I have two tables:
OR_CUs
OR_CEOs
>
They share (can be joined on) a field called [CU], which is just the
name of the CU.
>
All I want to do is get the email address field (EMAIL) from OR_CEOs
and into OR_CUs. Once that's done I will get rid of OR_CEOs. I've
created an empty field in OR_CUs, also called EMAIL.
>
I've tried UPDATE queries and access always ends up asking me what my
references are (even though they're qualified by the table name). I'm
fairly new to SQL but this seems so elementary. Hah.
>
Thanks for any help.
John
Jan 12 '07 #4
Thanks for all your help Jason, that query was what I needed. I've got
it now. Just need to do a little pruning on one field (some extraneous
characters were gumming up the works) and it's all good from there.

Tip o' the hat to ye,
John
Jason Lepack wrote:
Are there spaces at the start or end of your names? you could try
Trim( )

Cheers,
Jason Lepack

JohnH wrote:
Thanks for your response. I'm having trouble now with case, methinks.
The CU field I'm joining on is all uppercase in one table and lowercase
in the other. I tried adding UCASE( ) for the elements in the ON
clause:

UCASE(OR_CEOs.CU) = UCASE(OR_CUs.CU)

to no avail. Any ideas?
Jason Lepack wrote:
In query designer add both tables.
Join the two tables on [CU]
Put the field that you want to update ([OR_CUs].[email]) in the Field
In Update To put [OR_CEOs].[email]
>
I personally wouldn't use the letters "OR" in a table name because they
look like OR statements in the SQL.
>
SQL looks like this:
UPDATE OR_CEOs
INNER JOIN OR_CUs ON OR_CEOs.CU = OR_CUs.CU
SET OR_CUs.Email = OR_CEOs.Email;
>
Cheers,
Jason Lepack
>
JohnH wrote:
I have a simple task to perform that I cannot seem to figure out.

I have two tables:
OR_CUs
OR_CEOs

They share (can be joined on) a field called [CU], which is just the
name of the CU.

All I want to do is get the email address field (EMAIL) from OR_CEOs
and into OR_CUs. Once that's done I will get rid of OR_CEOs. I've
created an empty field in OR_CUs, also called EMAIL.

I've tried UPDATE queries and access always ends up asking me what my
references are (even though they're qualified by the table name). I'm
fairly new to SQL but this seems so elementary. Hah.

Thanks for any help.
John
Jan 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10675
by: news | last post by:
Hi there, I have a table in an Oracle 9i R2 database containing the following string" "It's so easy" When I try to execute the following query: SELECT EXPRESSION FROM EXPRESSIONS WHERE...
3
7327
by: David | last post by:
Consider this SQL Query: ----------------------------------------------------------------- SELECT c.CASE_NBR, DATEDIFF(d, c.CREATE_DT, GETDATE()) AS Age, c.AFFD_RCVD, c.PRV_CRD_ISS, x.RegE,...
3
2184
by: Andy Visniewski | last post by:
Should be easy, but I've been trying to figure this out for about half an hour with no luck. There is a table 'Cybex' which has all the Cybex products we sell, and a table 'Datasheets' which...
7
1294
by: Tim | last post by:
hi all, I have a table of customers. I have a table of products they have ordered. How can I find all customers who have ordered productA and productB at any time. It sounds so easy, but...
13
1943
by: Dmitry Tkach | last post by:
Hi, everybody! Here is a weird problem, I ran into... I have two huge (80 million rows each) tables (a and b), with id as a PK on both of them and also an FK from b referencing a. When I try to...
1
3072
by: Nicolae Fieraru | last post by:
Hi All, I want to find if there is a different way than the way I am working now. Lets say I have a table, tblCustomers containing address details. I want a report with all the customers from...
1
3214
by: u473 | last post by:
I am scratching my head with the required quotes and parentheses. I started with an existing working Query with Running Total by date. Now I need to produce a running total by quarter day, so I...
9
1708
by: JT | last post by:
I am working on a basic webpage in PHP connecting to a mySQL database, here is my query... //query 1 $query_rs_staff = "SELECT * FROM jtStaff WHERE locationID=".$_GET; $rs_staff =...
3
2718
by: martin1 | last post by:
rHi, All I knew cross-tab quesy is easy done on the Access DB, is there easy way to do cross-tab query for SQL server DB in VB.NET 2005 Dev environment? Thanks
9
2725
by: Carl Witte | last post by:
Hi. I'm working with a web service who requests data uploaded as an xml string with xmlhttp "POST" command. I've got the data in a query that I want to send. Unfortunately it doesn't appear thier...
0
6920
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
7106
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
7022
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...
0
5365
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,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.