A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update question for a query



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2004, 08:39 PM
bladelock
external usenet poster
 
Posts: n/a
Default Update question for a query

I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all
  #2  
Old August 5th, 2004, 01:22 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default Update question for a query

What I'm understanding is that you want to put a number in for a name in
table A if the name in table A is Null (empty)? But, if you want to join the
two tables on the name field from table A, the join won't work if name is
empty in table A.

Perhaps you can show a few examples of data and what the result should be to
help us better understand.

--

Ken Snell
MS ACCESS MVP

"bladelock" wrote in message
...
I have two tables, A-Table and B-Table. A-Table has Names(Text),

Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table

for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both

names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all



  #3  
Old August 5th, 2004, 01:23 AM
MGFoster
external usenet poster
 
Posts: n/a
Default Update question for a query

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

UPDATE TableA As A LEFT JOIN TableB As B
ON A.Numbers = B.Numbers
SET A.Name = B.Name
WHERE A.Name Is Null

--
MGFoster:::mgf00 at earthlink decimal-point net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRF99IechKqOuFEgEQIXaQCg7WhDeYb7B23RJwqvi18yoH t1JV0AnRw4
wg1Y7Hnj7LRgujOx3fJlIpw9
=7xmj
-----END PGP SIGNATURE-----


bladelock wrote:

I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all


  #4  
Old August 5th, 2004, 01:41 AM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default Update question for a query

I think I might understand your problem.

UPDATE ATable INNER JOIN BTable
On ATable.Numbers = BTable.Numbers
SET ATable.Names = BTable.Names
WHERE ATable.Names is Null Or ATable.Names = ""

bladelock wrote:

I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all

  #5  
Old August 5th, 2004, 02:09 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default Update question for a query

Guess I need more coffee in the evenings.....

!!!


--

Ken Snell
MS ACCESS MVP

"John Spencer (MVP)" wrote in message
...
I think I might understand your problem.



  #6  
Old August 5th, 2004, 10:11 PM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default Update question for a query

No, just more relaxation, so your psychic abilities can kick in and interpret
the OP's meaning by enfolding the entire posting and 'grokking' it. See
"Stranger in a Strange Land" by R.A. Heinlein for the reference.

Ken Snell wrote:

Guess I need more coffee in the evenings.....

!!!

--

Ken Snell
MS ACCESS MVP

"John Spencer (MVP)" wrote in message
...
I think I might understand your problem.

  #7  
Old August 6th, 2004, 02:09 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default Update question for a query

"John Spencer (MVP)" wrote in message
...
No, just more relaxation, so your psychic abilities can kick in and

interpret
the OP's meaning by enfolding the entire posting and 'grokking' it. See
"Stranger in a Strange Land" by R.A. Heinlein for the reference.


I have that one! g
--

Ken Snell
MS ACCESS MVP


  #8  
Old August 6th, 2004, 01:01 PM
bladelock
external usenet poster
 
Posts: n/a
Default Update question for a query

Thanks again

"John Spencer (MVP)" wrote:

I think I might understand your problem.

UPDATE ATable INNER JOIN BTable
On ATable.Numbers = BTable.Numbers
SET ATable.Names = BTable.Names
WHERE ATable.Names is Null Or ATable.Names = ""

bladelock wrote:

I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all


  #9  
Old December 3rd, 2009, 08:24 PM posted to microsoft.public.access.queries
Tloliver79
external usenet poster
 
Posts: 2
Default Update question for a query

When I use this example; I get a popup for the parameter ? Here is my sequel:

UPDATE NB_200912A INNER JOIN NB_200912MAIL ON NB_200912A.MEMID =
NB_200912MAIL.MEMID SET NB_200912MAIL.Adr = ADDRESS.NB_200912A
WHERE (((NB_200912MAIL.Adr) Is Null Or (NB_200912MAIL.Adr)=" "));

What am I missing?

"John Spencer (MVP)" wrote:

I think I might understand your problem.

UPDATE ATable INNER JOIN BTable
On ATable.Numbers = BTable.Numbers
SET ATable.Names = BTable.Names
WHERE ATable.Names is Null Or ATable.Names = ""

bladelock wrote:

I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all


  #10  
Old December 4th, 2009, 12:12 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Update question for a query

You seem to have flipped the table name and field name in the set clause.
Also put brackets around the table name and field name on the right side

Change the following
SET NB_200912MAIL.Adr = ADDRESS.NB_200912A
to
SET NB_200912MAIL.Adr = [NB_200912A].[ADDRESS]

UPDATE NB_200912A INNER JOIN NB_200912MAIL
ON NB_200912A.MEMID = NB_200912MAIL.MEMID
SET NB_200912MAIL.Adr = [NB_200912A].[ADDRESS]
WHERE (((NB_200912MAIL.Adr) Is Null Or (NB_200912MAIL.Adr)=" "));


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Tloliver79 wrote:
When I use this example; I get a popup for the parameter ? Here is my sequel:

UPDATE NB_200912A INNER JOIN NB_200912MAIL ON NB_200912A.MEMID =
NB_200912MAIL.MEMID SET NB_200912MAIL.Adr = ADDRESS.NB_200912A
WHERE (((NB_200912MAIL.Adr) Is Null Or (NB_200912MAIL.Adr)=" "));

What am I missing?

"John Spencer (MVP)" wrote:

I think I might understand your problem.

UPDATE ATable INNER JOIN BTable
On ATable.Numbers = BTable.Numbers
SET ATable.Names = BTable.Names
WHERE ATable.Names is Null Or ATable.Names = ""

bladelock wrote:
I have two tables, A-Table and B-Table. A-Table has Names(Text), Numbers(Num). B-Table has Names(Text), Numbers(Num).

I want to replace all A-Table with Names for Names = Numbers from B-Table for A-Table Names = "Null" or blank

REMEMBER: A-Table has the Numbers, but not the names, B-Table has both names and numbers AND I ONLY WANT the names that are blank (null)

Is there a way I can do this? Thanks all

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Values to Null or False Using a Update Query Chris Belcher Running & Setting Up Queries 2 August 2nd, 2004 11:34 PM
DSum in Update Query Arvin Villodres Running & Setting Up Queries 5 July 15th, 2004 05:26 AM
Hidden files in Ms-Query cause ODBC connect errors or Query is wac needyourhelp General Discussion 4 July 12th, 2004 09:38 PM
Updating Two Related Fields in One Query SANJAY SHAH \(MICROBRAIN Computers Pvt. Ltd.\) Running & Setting Up Queries 3 June 9th, 2004 12:23 PM
Need help! Parameter update query to form Le Tran New Users 7 June 8th, 2004 06:26 PM


All times are GMT +1. The time now is 01:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.