Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign Field Value?

Status
Not open for further replies.

EZLI

IS-IT--Management
Sep 3, 2002
31
LV
Hi,
I have a table:

ID 1
Date 01.07.04
Field1 A
Field2 B

How to assign Field2 value "B" to Field1 for next record (Date)?
Must look so:

ID 2
Date 01.08.04
Field1 B
Field2 C

ID 3
Date 01.09.04
Field1 C
Field2 D

Thank's in advance for help.
 
something like:

UPDATE tblName T1 SET T1.FIELD1 = (SELECT T2.FIELD2 FROM tblName T2 WHERE T1.[SomeDate] = DateAdd(T2.[SomeDate], 1))

you may need to check on the DateAdd function, I'm pretty sure I'm missing a parameter, but I don't have Access on this machine so I can't check! :eek:(

I would question why you would need this done if your tables are normalized.



Leslie
 
Thank You for the answer.
The problem is that I would like to organise
all this in one Table T1.
Have You some Idea?

Bob
 
what do you mean, all in one table? I'm only using one table. put your table name where it says tblName (both places) put your field name in Field1 and Field2 where appropriate.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top