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 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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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,...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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 =...
|
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
|
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...
|
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...
| |
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...
|
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: 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: 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...
|
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...
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |