473,406 Members | 2,336 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,406 software developers and data experts.

Update Column with Content of other table

Hi,
got:
[T1]![Nr]
[T2]![TT]

How to overwrite (update) all elements of [T2]![TT] with Max (or
latest) of [T1]![Nr] ?
I tried if with a Update-Querry - without success.

Thankx

Mar 13 '07 #1
6 4279
On Mar 13, 5:43 am, "tone" <anton.sutterlu...@pantec.comwrote:
Hi,
got:
[T1]![Nr]
[T2]![TT]

How to overwrite (update) all elements of [T2]![TT] with Max (or
latest) of [T1]![Nr] ?
I tried if with a Update-Querry - without success.

Thankx

Any query using a calculation is automatically not updateable. You
need to use two queries - one to get the desired info, the second to
update based on the first.

Mar 13 '07 #2
Yeap, now I'm using to queries:
GetMax and UpdateT2 (which uses GetMax):
UPDATE T2, GetMax SET T2.TT = [GetMax]!MaxvonNr;

As soon I open UpdateT2 it says that the operation has to us an
updateable query!
Help!


Mar 13 '07 #3
I think you will need to change your summation query into an append or make
table query, then use that temp table to update your original table.

"tone" <an***************@pantec.comwrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Yeap, now I'm using to queries:
GetMax and UpdateT2 (which uses GetMax):
UPDATE T2, GetMax SET T2.TT = [GetMax]!MaxvonNr;

As soon I open UpdateT2 it says that the operation has to us an
updateable query!
Help!


Mar 13 '07 #4
He, kind a simple work-around.
Thanx so long, Ron

Mar 13 '07 #5

I apologize, I thought it would work.
An alternative to using a maketable would be to use a function in an
update (I have tried it and it works for my limited example)...

Query:
UPDATE [TABLENAME] SET [TABLENAME].[FIELDNAME]= MaxOfValue();

Add something like this to a module. Modify to use appropriate table
and field names:

Function MaxOfValue() As Variant
MaxOfValue = DMax("[FIELDNAME]", "[TABLENAME]")
End Function

Sorry again.

Mar 13 '07 #6
Thanks storrboy, you guys's great
This also works
Mar 13 '07 #7

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

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
1
by: C.P. | last post by:
I am trying to transform data inside one of my tables. However, I only want to change part of the data in a column because the last part is basically a UniqueID to a file. Is it possible to only...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
2
by: Miro | last post by:
I will ask the question first then fumble thru trying to explain myself so i dont waste too much of your time. Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an index - i...
0
by: Nesa | last post by:
Hi, I am accessing DB2 8.2 (Windows) via JDBC type 4 and am having troubles making Blob.setBinaryStream(long) work to update a BLOB column. Here is the excerpt of code that I am using: ...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
0
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,...

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.